Site logo

[Resolved] RTL Page inside LTR Website

Home Forums Support [Resolved] RTL Page inside LTR Website

Home Forums Support RTL Page inside LTR Website

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2451313
    Monya

    Hi,

    If my whole website is in English (LTR) and I would like to have one page only inside that page to be in Arabic (RTL), is it possible?

    #2451407
    David
    Staff
    Customer Support

    Hi there,

    try adding this CSS to your site:

    
    .page-id-2759 #page {
        direction: rtl;
    }

    Note its uses the page-id-* body class to target just that page.
    And i assumed only the page content should be changed so we target the #page container to do that,

    #2480388
    Monya

    Hi,

    If my whole website is in English (LTR), and I have a page called News

    some posts are in English (LTR) and other posts are in Arabic (RTL)

    How can I target the Arabic post and force it to stare from (RTL)?

    #2480560
    David
    Staff
    Customer Support

    We would need to target the specific posts in the loop to do that.
    Is it possible to add a Tag to the posts that are written in Arabic ? Then that tag could be used to style those posts.

    #2481473
    Monya

    If the tag is the only option that can fix it, then I have to do that

    could you please guide me on how to style the post using tags?

    #2481603
    Monya

    Also I have an other question

    If I have a post in English (LTR)

    That post have 2 paragraphs, one in English (LTR) and the other one in Arabic (RTL)

    Can I change the style of each paragraph then one can start from LTR and the other one from RTL in the same post?

    #2481715
    David
    Staff
    Customer Support

    In WP there is the post_class function which adds classes to the post article HTML element. Which applies to archives and single posts. Post classes include some meta about that specific post including classes that show the post taxonomies.

    The class syntax they use are like so:

    Categories: category-{term-slug}
    Tags: tag-{term-slug}

    1. If you add a tag or rtl to any post that is 100% RTL language. It will have the tag-rtl class
    NOTE this will only apply to Posts ( not pages )
    2. For your paragraph of text, in the editor, select the Text block, and in Advanced > Additional CSS class(es) add: rtl
    3. Change the above CSS to:

    
    .page-id-2759 #page,
    .tag-rtl,
    .rtl {
        direction: rtl;
    }

    If you intend to have many pages that are to be 100% RTL it is possible to enable Tags on pages.

    #2481777
    Monya

    I am sorry, but it didn’t work with me, maybe because I am new to WordPress

    Is there a document tutorial with screenshot or a video tutorial that could help me?

    #2481786
    David
    Staff
    Customer Support

    Ok, so lets take it one at a time 🙂

    1. Adding the rtl tog to your post. First edit the post then see here:

    https://www.screencast.com/t/eS6gBmvf2t8w

    2. Add a class to the text block. Select the text block and see here:

    https://www.screencast.com/t/BOq2lvbrzhv

    3. Then go to the Customizer > Additional CSS and paste in this CSS:

    .page-id-2759 #page,
    .tag-rtl,
    .rtl {
        direction: rtl;
    }
    #2481798
    Monya

    Thank you so much for your help, it is working now ^_^

    my last question,

    .page-id-2759

    the number 2759, can I use it for all my posts inside the news page?

    #2481845
    David
    Staff
    Customer Support

    So .page-id-2759 #page, was to style the original page you wanted to make RTL it only affects that page.

    #2481968
    Monya

    Well noted with thanks ^_^

    #2482405
    David
    Staff
    Customer Support

    You’re welcome

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