Your address will show here +12 34 56 78

Home Forums General topics for our real estate themes How can I use RTL with LTR style.css in WPML

This topic contains 1 reply, has 2 voices, and was last updated by  sami 2 years, 8 months ago.

  • Author
  • #102689

    I just use your wpestate child template and style.css (that i did not modified for now), so i have nothing to send to you… how can i use RTL with also english? should i add a function calling the rtl when visiting hebrew pages?

    –> This one is tricky. Took me hours to research on WPML. Hope it helps.

    the style.css from child theme must be added as rtl.css in main theme.

    Then you must modify functions.php to add the code the conditions which style.css or rtl.css to load based on the language codes you have.

    The function is

    function enqueue_styles() {
         if(ICL_LANGUAGE_CODE == 'en'){ //english
              wp_enqueue_style( 'style', get_stylesheet_directory_uri() . "/style.css", array(), null );
         if(ICL_LANGUAGE_CODE == 'fa'){ //persian
              wp_enqueue_style( 'style', get_stylesheet_directory_uri() . "/rtl.css", array(), null );

    add before

    add_action( ‘wp_enqueue_scripts’, ‘enqueue_styles’ );

    You must update this php code with your own language codes.

    WPML can help more if needed as this is part of their plugin code and help.



    In child theme WPML doesn’t read my_media.css even if the @import is set correctly. So you must copy my_media.css from main theme to rtl.css

  • #103549


    Hi anna

    The RTL file you sent me by mail is for wpresidence and I have wpestate..


You must be logged in to reply to this topic.