How to add a parameter to every query string?
-
Hi,
I have a problem. I have a website with woocommerce product table plugin. I use your plugin only for searching products. When I try to search for something, then I am redirected to wrong site. I mean I should be redirected to a page where woocommerce product table works. The reason for that is query string looking like for ex:
“?s=earrings” when I search “earrings”. Then, I am not redirected to woocommerce product table search results. The query should looks like: “?s=earrings&post_type=product” , then it works. How to add the parameter “post_type=product” to every search query?I was trying to change this but I don’t know PHP enough good please help https://searchwp.com/documentation/hooks/searchwp-query-search_string/#parameters
Also, I use only searchwp for searching products, and other engines I have deleted, but If I would like to use the main search also for pages for ex. then of course I don’t want this parameter to be added, is it possible to achieve this by simple snippet or plugin files must be changed?
- The topic ‘How to add a parameter to every query string?’ is closed to new replies.