It’s your theme.
When you search for “BPMA”, you’ll see the search results page URL looks like this:
https://www.kaffeebecher24.de/?s=bpma&post_type=product
Notice the post_type=product
in there? That restricts the results to products only. Remove that and you get:
https://www.kaffeebecher24.de/?s=bpma
which finds the post you want to find.
Your search form includes this:
<input type="hidden" name="post_type" value="product">
This is what adds the post type restriction to the search. You can remove it from the search form to make the search find all post types, but it’s worth noting that your theme – like many WooCommerce themes – only shows the product search layout when the parameter is present. When it’s not there, you’ll get a different search results layout.
If you don’t know how to edit the search form, you can also add this to your theme functions.php file to make the search include also posts:
add_filter( 'relevanssi_modify_wp_query', 'rlv_force_post_product' );
function rlv_force_post_product( $query ) {
$query->query_vars['post_types'] = 'post,product';
return $query;
}
Hi Mikko,
thank you for your quick reply. That was very helpful – I’ve understood the problem at hand and how the the inner workings work here.
I’ve added the code to the functions.php as well as the functions-enfold.php, because I can’t edit the search form.
However it seems that it doesn’t take effect. I will talk to the Enfold support about this.
Thank you so much!
Franz