I know you have made it possible to limit what the search function searches for, posts, products etc.. But, correct me if I'm wrong, this limit still allows products with the visibility "hidden" to show up in the search results.
Would it be possible to change the search function so that (if products is the only type that should be searched for) it prompts: [...]&post_type=product
As I know, the query results for products are filtered only when post_type=product parameter is added in the url, so to make this available in default search functionality please add the following code in functions.php:
Hi,
I know you have made it possible to limit what the search function searches for, posts, products etc.. But, correct me if I'm wrong, this limit still allows products with the visibility "hidden" to show up in the search results.
Would it be possible to change the search function so that (if products is the only type that should be searched for) it prompts:
[...]&post_type=product
That way, hidden products are not included.
Or is there another way?
Thanks!
Hi minded,
As I know, the query results for products are filtered only when post_type=product parameter is added in the url, so to make this available in default search functionality please add the following code in functions.php:
Worked perfectly!
Hi minded,
I'm happy to hear that
P.S: If you like the theme, it would help us a lot if you could give us a five-star rating on Themeforest from your Downloads tab.
A huge thank you from me and Laborator in advance <3