Tagged: rtl
-
AuthorPosts
-
March 29, 2020 at 11:00 am #1198791
Hey, I want to build a website that has a hebrew version (in addition to the english version) is there a possibility to make specific pages on the website in RTL mode while the others are LTR?
Thanks
-
This topic was modified 5 years, 8 months ago by
kfir_menashe.
March 29, 2020 at 10:08 pm #1198950Hey kfir_menashe,
To enable the RTL only on some pages on your site please add this code to the end of your functions.php file in Appearance > Editor:function enqueue_rtl() { if ( is_page( array( 597, 'features', 'meet-the-team' ) ) ) { wp_enqueue_style( 'avia-rtl', get_template_directory_uri()."/css/rtl.css", array(), '1', 'screen' ); } } add_action( 'wp_enqueue_scripts', 'enqueue_rtl', 100 );you can change the pages it changes to RTL in the “array” in the code above, just add “Page IDs” or “Page Titles” or “Page Slugs”
Best regards,
MikeApril 3, 2020 at 10:07 pm #1200667Thanks for the answer Mike but it does not seem to work.
I added the code to the functions.php and added a page to check but I see no change.
Since Im not really that femiliar with html can you please write an example of how you would enter a page to the array using the page slug ?thanks
April 4, 2020 at 12:19 pm #1200782Hi,
The code above is a working example with the slug “meet-the-team”, Please include an admin login in the Private Content area and the test page you wish to use.
Perhaps you are missing a bracket from the code.Best regards,
MikeApril 9, 2020 at 10:28 am #1202198It works, Thanks
is there a way to do the same for posts and portfolio items?April 10, 2020 at 1:16 pm #1202656Hi,
Glad to hear that it is working for you, instead of usingif ( is_page )you could useif ( is_singular )is_singular() is for existing single post of any post type (post, attachment, page, custom post types including portfolio items).
Please explain if you want to define when this is active or when it is not active. Do you want the RTL on most pages & posts or just a few?Best regards,
Mike -
This topic was modified 5 years, 8 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
