Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › RTL for Another Search Bar
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 2 years, 9 months ago.
- AuthorPosts
- August 6, 2020 at 2:30 pm #28828
Hello,
first,you have no idea how much i love your plugin. you rock.my question : i have two pages with two diffrent search bars, i want one of them to be RTL. how can i do it ?
Best Regards,
August 6, 2020 at 2:56 pm #28829Hi,
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:
Best,add_filter( 'body_class', function( $classes ) { if ( get_the_ID() = 1234 && isset( $classes['rtl'] ) ) { unset( $classes['rtl'] ); } return $classes; }, 9999999 );
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
August 6, 2020 at 3:05 pm #28830Thanks for your fast respond,
I have zero coding experience, so i just copied the last box and put it in (theme & styling / Custom CSS) .
force refresh + cleared cache and nothing changed.
to be clear : (my site is English and i want the search bar results and typing to be RTL) .
August 6, 2020 at 3:08 pm #28831Well, this is only a sample code, you will have to expand that and change the page ID, as well as test it. I’m not sure if it works, I could only give an example unfortunately.
If you need help with implementation, I usually recommend envato studio if you are looking for a developer.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.