I am using qTranslate plugin which allows me to translate posts and fields.
The first language is English, the second language is Arabic which requires RTL design.
I followed their FAQ and WordPress’ Right-to-Left Language Support.
The FAQ of the plugin says it should work automatically but if it doesn’t that I need to check WordPress’ documentation on the issue, so I did, it says this:
Start with your main theme stylesheet (usually style.css). Save this
file as rtl.css Add the following attributes to the body selector:
direction: rtl;
unicode-bidi: embed;
So I created a new copy of style.css
and named it rtl.css
then added direction:rtl
to the body selector.
But it’s not working, when I switch the language to Arabic, it still displays LTR.
However if I add direction:rtl
to the body selection in style.css
it works, the theme switches to RTL.
What can I do in this situation?
The only way I managed to get this to work is by creating a new class in my css called
direction
and included it whenever the language was Arabic, by doing thisIn case you need to redirect browse view to read from RTL and by using qtranslate-x plugin, add code below at header.php
then at function.php, use wp_enqueue_style, wp_style_add_data, to detrmine which stylesheet you need to read as rtl
reference link:
– https://codex.wordpress.org/Right-to-Left_Language_Support
– http://princessdesign.net/wpsnippets/qtranslate/