Home Forums WoodMart support forum RTL CSS file generator

RTL CSS file generator

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #212836

    emad
    Participant

    Hi

    I have a multi language website using WPML English and Arabic is work fine and your theme is perfect but something i did’t get’t i use CSS file generator for RTL language but is effect for all website even English language how generate RTL css only for Arabic
    i make a child theme and it has rtl.css i use it for my custom codes am not sure is effect in CSS file generator or there anther a way to do that

    Thanks

    #212842

    Artem Temos
    Keymaster

    Hello,

    Thank you so much for purchasing our theme and contacting our support center.

    Yes, the CSS generator replaces theme’s CSS files with generated one and it may be either RTL or LTR. Unfortunately, it is not possible to use CSS generator on websites that have both Arabic and English versions.

    Kind Regards
    XTemos Studio

    #212849

    emad
    Participant

    Hi
    thank you for fast response i contact with WPML support they give me the below code

    function enqueue_styles() {
         if(ICL_LANGUAGE_CODE == 'en'){ //english
              wp_enqueue_style( 'style-css', get_template_directory_uri() . "/style-.css", array(), null );
         }
     
         if(ICL_LANGUAGE_CODE == 'ar'){ //arabic
              wp_enqueue_style( 'style-rtl.css', get_template_directory_uri() . "/css/style-rtl.css", array(), null );
         }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_styles' );
    
     function se_remove_script() {
        if(ICL_LANGUAGE_CODE == 'en'){ //english
              wp_enqueue_style( 'style-css', get_template_directory_uri() . "/style-.css", array(), null );
         }
    }
    add_action( 'wp_print_scripts', 'se_remove_script', 99 );

    is working but in Arabic the RTL style and the normal one now are merge together so be become more missy am trying blocking the normal style form Arabic if you see the code can you help me or do you think this way will work?

    #212857

    Artem Temos
    Keymaster

    This code has no any relation to our CSS generator. The only way to make it work correctly now is to disable the CSS generator completely. Then, our theme’s styles will be loaded and it will look well both on English and Arabic.

    #212863

    emad
    Participant

    how i disable it? is there switch fo it ?

    #212873

    Artem Temos
    Keymaster

    You need to go to Dashboard -> WoodMart -> CSS generator and remove the file completely.

    #212885

    emad
    Participant

    works like a charm thank you very much

    #212887

    emad
    Participant

    that code i use

    function enqueue_styles() {
         if(ICL_LANGUAGE_CODE == 'en'){ //english
              wp_enqueue_style( 'style-css', get_template_directory_uri() . '/style.css', array( 'woodmart-style' ), woodmart_get_theme_info( 'Version' ) );
         }
     
         if(ICL_LANGUAGE_CODE == 'ar'){ //arabic
              wp_enqueue_style( 'style-rtl.css', get_template_directory_uri() . "/css/style-rtl.css", array(), null );
              wp_deregister_style( 'style-css', get_template_directory_uri() . '/style.css', array( 'woodmart-style' ), woodmart_get_theme_info( 'Version' ) );
         }
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_styles' );
    
    #212911

    Artem Temos
    Keymaster

    We are glad that you sorted it out.

Tagged: 

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘RTL CSS file generator’ is closed to new replies.