Search code examples
wordpressright-to-left

Mix of LTR & RTL in Wordpress post titles


I'm developing a site which is basically a Questions/Answers Site in English & Arabic.

Currently, the questions posted in English are not formatted in Arabic version of site and same happens in English version of site that Arabic questions are on left side too.

I want to ask, is there a plugin or custom way to support mix of languages in both language versions?


Solution

  • Generally you could use some tactics:

    For different language pages / posts - install a Language plugin. I recommend PolyLang which is both lightweight & easy to configure.

    For different styles - use CSS. for example the :lang() selector as noted in this article https://css-tricks.com/almanac/selectors/l/lang/.

    also, you could output the language itself in PHP as some sort of custom field - and than control the styles as you wish. example:

    <div class="question english"> ... </div>
    
    <div class="question arabic"> ... </div>
    
    .question.english { direction: ltr; }
    .question.arabic { direction: rtl; }
    

    and so on...