Site logo

Archived topic

SearchWP Live Search

11 replies · Started by Michael Largue on November 9, 2017

Viewing posts 1–12 of 12

You could try this function:

add_filter( 'generate_navigation_search_output', 'tu_nav_live_search' );
function tu_nav_live_search() {
    printf(
        '<form method="get" class="search-form navigation-search" action="%1$s">
            <input type="search" class="search-field" value="%2$s" name="s" title="%3$s" data-swplive="true" />
        </form>',
        esc_url( home_url( '/' ) ),
        esc_attr( get_search_query() ),
        esc_attr_x( 'Search', 'label', 'generatepress' )
    );
}

Hi Tom
Unfortunately, it does not work. Instead of returning progressive actual items found (ajax), it behaves in the same manner as it originally di.

According to their instructions, that should be all that's needed. Any chance you can link me to your site?

Hi Tom
Correction, it does work. I forgot to activate it. Doh! Thank you very much.
Regards
Michael

I forgot to mark it as resolved...

Glad I could help :)

The function seems to work partially now. Each link from the result box needs to be double-clicked in order to open a page. See here

Any ideas on how to fix it?

Update: I've just found that the problem doesn't occur when I use the search widget. The navigation search still needs a double-click. Could you please take a look at the CSS settings of the nav search and the result box? Maybe there's a conflict between the two properties.

That's strange, it almost looks like a bug with the focus. Any chance you can report it to the plugin author? They might know why this could happen/what we can do to fix it. Maybe just removing focus once the results are shown would fix it.

Nevermind, Tom. I'm now using Dave's WordPress Live Search and it's almost perfect. I have one issue with CSS but I'm opening a new ticket to solve it.

Thanks for your help anyway!

No problem :)

This archived topic is closed to new replies.