[Resolved] Replacing default navigation search / adding AJAX functionality

Home Forums Support [Resolved] Replacing default navigation search / adding AJAX functionality

Home Forums Support Replacing default navigation search / adding AJAX functionality

  • This topic has 3 replies, 2 voices, and was last updated 2 years ago by David.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2188476
    Filip

    Hello.

    The site is https://molitve.rs.

    I’ve also installed the Ajax Search Lite plugin which automatically suggests and shows results as you’re typing into it.

    Link to the image

    Is there any way I could replace the default one with the one I’ve installed, or add ajax functionality to the native one?

    I’ve also tried this, but it’s not working:

    this

    Thanks in advance!

    #2188483
    David
    Staff
    Customer Support

    Hi there,

    the Navigation Search has a separate search form but it has the generate_navigation_search_output filter so you can add your own form:

    https://docs.generatepress.com/article/generate_navigation_search_output/

    For example you could use this to add a shortcode form:

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

    Just swap out the [your-search-plugin-shortcode] with the plugins shortcode.

    #2188501
    Filip

    Thanks a lot, David!

    #2188504
    David
    Staff
    Customer Support

    You’re welcome

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