[Resolved] Replacing navigation bar search with Ajax search

Home Forums Support Replacing navigation bar search with Ajax search

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1439847
    madmanweb

    Hi.

    I have an Ajax search plugin that I want to use for my site. It’s called Ajax Search Lite – https://wordpress.org/plugins/ajax-search-lite/

    It gives me the option of either a shortcode or this code to insert into the theme file:

    <?php echo do_shortcode('[wpdreams_ajaxsearchlite]'); ?>

    Any ideas on how to go about replacing the navigation search with this?

    #1439857
    Elvin
    Customer Support

    Hi,

    You can try this code:

    add_filter( 'generate_navigation_search_output', function() {
        return sprintf(
            '<div class="navigation-search">%s</div>',
            do_shortcode( '[your-shortcode]' )
        );
    } );

    Let us know if it works for you.

    #1439860
    madmanweb

    Yes, that did it, thanks.

    #1439920
    Elvin
    Customer Support

    Nice one!

    No problem. Always glad to be of any help.:)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.