RTL for Another Search Bar

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 Ernest Marcinko 2 years, 9 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #28828
    alghaith87
    alghaith87
    Participant

    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,

    #28829
    Ernest Marcinko
    Ernest 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 );
    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #28830
    alghaith87
    alghaith87
    Participant

    Thanks 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) .

    #28831
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Well, 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 :)


Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.