Hi!
I want ask for helo with how the search form shows the result. I want to show all the result (even if it’s only one) in the archive page format, I use the filter:
add_filter( 'generate_navigation_search_output', function() {
printf(
'<form method="get" class="search-form navigation-search" action="%1$s">
<input type="search" placeholder="Enter your search" class="search-field" value="%2$s" name="s" title="%3$s" />
<input type="hidden" name="post_type" value="product" />
</form>',
esc_url( home_url( '/' ) ),
esc_attr( get_search_query() ),
esc_attr_x( 'Search', 'label', 'generatepress' )
);
} );
But when is only one result, it directly re-direct to the product page and what I want is to show that product on archive page (because my shop doesn’t have product page).
Thank you for your help!