How to load a specific Stylesheet in my WordPress template only when in RTL mode

I have a Bootstrap3 built theme in WordPress, I’m working on translating and converting the theme from LTR to RTL.

So I want to load this stylesheet https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.2.0-rc2/css/bootstrap-rtl.min.css only on RTL mode on my WordPress Theme. How can I do this?

Related posts

1 comment

  1. You can use is_rtl() in your theme:

    if ( is_rtl() ) {
      wp_enqueue_style(  'style-rtl',  'https://cdnjs.cloudflare.com/ajax/libs/bootstrap-rtl/3.2.0-rc2/css/bootstrap-rtl.min.css' );
    }
    

Comments are closed.