1

Regularly we have themes in English that supports RTL, but my case is vice versa. So imagine we have a custom theme that developed in Hebrew, so it's Right To Left. Now I want to know how can I adding LTR support to this theme ?

The use case is having a multi language website using WPML plugin. Just adding a ltr.css to the theme and add proper styles will do the works ?

Any help is appreciated.

  • Can you elaborate more on your use case? It isn't quite clear what you are trying to achieve this! How do you intend identifying the language and indexing DOM elements within your ltr.css file? – nyedidikeke Nov 1 '16 at 10:55
  • Thanks for your reply @nyedidikeke. That's exactly what I want to know about. how can I identitying languages and change direction, etc About my use case. I have a custom theme that only supports RTL. Now I want to add English and Turkish versions using WPML plugin. I want to know how can I add supports for LTR to my theme. How should I configure my theme code (or plugin) to when user clicked on En, all pages going LTR, and other considerations on this process. – startToday Nov 1 '16 at 11:36
  • Any idea, please ? – startToday Nov 2 '16 at 7:24
  • I don't know what WPML plugin you are using, but one should expect from such a plugin (for website translation) to handle effectively language switches out of the box! You should contact your theme and or your WPML plugin author for assistance as your question now appears to be off-topic (questions concerning third party plugins and themes). – nyedidikeke Nov 2 '16 at 8:57
  • Take a look at this post on CSS-Tricks; is it of any help to addressing your challenge? – nyedidikeke Nov 20 '16 at 9:35
1

I created a ltr.css file and put that on theme's root folder. When checked the site in English, the ltr.css loads automatically. So as it seems Wordpress do all needed things in the background and there's no need to do in addition.

0

You can add LTR support by adding the ltr value to the dir attribute of your <html> element as in: <html dir="ltr">.

Further, it's advisable to define the language as well, so: you should be doing something like <html dir="ltr" lang="en">, using the lang attribute, here, with en as value, for English.
With more precision, you may use values such as: en-GB for British English, or en-US for American English, adding HTML ISO Country Codes Reference to the initial HTML Language Code Reference.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.