Hello,
How are you?
I just want to add the possibility to search for products that contain a specific product tag.
I have seen this code in the documentation:
add_filter( ‘generate_navigation_search_output’, function() {
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” />
<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 I think is for limiting the standard WordPress search to only products.
I found a solution by using the plugin WP Extended Search https://wordpress.org/plugins/wp-extended-search/ It adds a search for Select Taxonomies (e.g product_tag) but I would like to avoid using many plugins.
How can I add the product-tag search in the previous code?
Thank you very much for your help.
Kind regards,