This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: RTL for Another Search Bar

#28829
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Well, the RTL layout is applied based if the document body has the “rtl” class. I think the best solution would be to use the body_class hook, to remove the ‘rtl’ class.

There is an example for removing a class:

add_filter( 'body_class', function( $classes ) {
    if ( isset( $classes['class-to-remove'] ) ) {
        unset( $classes['class-to-remove'] );
    }
    return $classes;
} );

You could combine that with an ID check maybe:

add_filter( 'body_class', function( $classes ) {
    if ( get_the_ID() = 1234 && isset( $classes['rtl'] ) ) {
        unset( $classes['rtl'] );
    }
    return $classes;
}, 9999999 );