0

we all know that some languages have right to left "rtl" direction and we can add rtl.css file to modify theme layout in one of the languages that uses RTL direction.

the problem here is that, when i try to make changes to rtl.css file it does not take any effect, and that is because the theme load style.css file first which override my changes.

ex: in rtl.css i added: float: right;

in style.css i added: float: left;

for the same element... the theme loads style.css file first and override "float: right;" even in rtl languages.

i want to load rtl.css first in rtl languages.

thanks.

0

2 Answers 2

0

It is not "some", about 10% of the population of earth use rtl langs ;)

Anyway, rtl.css should always be loaded after style.css to be able to override the ltr styles when needed, hopefully without using !important.

0

You can also try to set the "priority" option

add_action('wp_head','AB_late_css',1);
function AB_late_css(){
    $source = get_stylesheet_directory_uri().'/adjust_ABplugins.css';
    wp_enqueue_style('adjust_ABplugins', $source);
}

where 1 is set a priority before the default priority of 10.

2
  • thanks for your reply, were to add this code and what to change with "rtl.css" as i`m new to wordpress world. Apr 20, 2016 at 19:39
  • Hi..You can add it in functions.php in your active theme folder. Replace "adjust_ABplugins.css" with "rtl.css" Apr 21, 2016 at 1:06

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