[Support request] RTL Mode not working

Home Forums Support [Support request] RTL Mode not working

Home Forums Support RTL Mode not working

  • This topic has 13 replies, 2 voices, and was last updated 3 years ago by Tom.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #542881
    Atef

    Hi,
    I have a multilingual website that depend WPML plugin.
    It has Arabic (RTL) language in it, however, the test displays LTR.
    please check this test post. this is a fresh WP installation:

    https://coptic-treasures.bcprafm7-liquidwebsites.com/book/church-history-vol-1-butcher/

    The theme has wpenqueue for the rtl.css in the functions.php, as follows:

    
    /**
     * GeneratePress child theme functions and definitions.
     *
     * Add your custom PHP in this file. 
     * Only edit this file if you have direct access to it on your server (to fix errors if they happen).
     */
    
    function generatepress_child_enqueue_scripts() {
    	if ( is_rtl() ) {
    		wp_enqueue_style( 'generatepress-rtl', trailingslashit( get_template_directory_uri() ) . 'rtl.css' );
    	}
    }
    add_action( 'wp_enqueue_scripts', 'generatepress_child_enqueue_scripts', 100 );
    

    what else I need to do to show the text RTL?

    Thanks.

    GeneratePress 2.0.2
    GP Premium 1.6.2
    #543116
    Tom
    Lead Developer
    Lead Developer

    Interesting, it’s like is_rtl() isn’t returning true.

    What’s your language set to in the WP settings?

    #543438
    Atef

    Hi Tom,

    the site language is “Arabic” in the WP General Settings Tab. please refer to the screenshot:
    http://prntscr.com/j20j7r

    thanks,

    #543505
    Tom
    Lead Developer
    Lead Developer

    What happens if you disable WPML?

    #544382
    Atef

    Hi Tom,
    Still No difference. I disabled WPML and all its plugins, but the post still shows LTR.

    thanks.

    #544602
    Tom
    Lead Developer
    Lead Developer

    Very strange – can you try adding this CSS?:

    body.rtl {
        text-align: right;
    }
    #544866
    Atef

    Hi Tom,
    if I added this code, the posts will show RTL. so what would be the issue here?
    thanks

    #544892
    Tom
    Lead Developer
    Lead Developer

    I’m not sure I understand? Aren’t we trying to make the posts show RTL?

    #544896
    Atef

    Yes we are.
    But I am asking why does the posts not show RTL without this custom code?
    is it:
    – compatibility issue in the theme code, or
    – Conflict in the latest WP update, or
    – Do I need to copy the rtl.css from the main theme to the child theme director, or
    – something else…etc?

    thanks

    #545508
    Tom
    Lead Developer
    Lead Developer

    That’s a good question – I couldn’t find the answer within your site.

    Lots of people are using RTL languages without this issue, so there needs to be something specific happening on your site.

    We’ll be digging deeper in the next few days to find the cause.

    #546251
    Atef

    Hi Tom,

    my wordpress installation for this site is hosted on a managed wordpress “service”. So I contacted the support team, and they did extensive checks on the installation.

    they found out that the GP Premium plugin is the cause, when they deactivated it, the website showed RTL.

    Ichecked this myself several times. when i activate the plugin, the text show LTR, when i deactivate it, it shows RTL.

    here is a post that shows now rtl, after i deactivated the plugin:
    https://coptic-treasures.bcprafm7-liquidwebsites.com/hello-world/

    i don’t have any custom css in the GP Premium or any custom code.

    I can provide you with login details as a proof.

    please advise.
    thanks.

    #546910
    Tom
    Lead Developer
    Lead Developer

    Very strange – I’ll do some digging and will let you know what I find out.

    Does the issue happen if you have the parent theme activated?

    #546946
    Atef

    Hi Tom,

    I dug a bit deeper and found that the problem appears when the GP Premium is active because I had the bootstrap code in the wp_head section:

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    The reason that I am switching to GeneratePress is that it is compatible with the WP Types plugin suite, which I will be using to build the site. The WP suite depends on Bootstrap, that’s why I had to add the code.

    Sorry for this confusion, but it was very tricky to find.

    So going forward, is the “wp_head” the best way to put this code?

    Thanks a lot.

    #547524
    Tom
    Lead Developer
    Lead Developer

    Ah, yes – wp_head is the correct hook for scripts. However, it must be some of the CSS in bootstrap overwriting the default RTL styling.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.