php – How to Add Extra Search terms with WordPress Search keyword term?

Question

Using the default WordPress search box, when we search for a term, it will result the URL as follows.

Search term: hello
URL: yourdomain.com/?s=hello

I want to add some extra text after the search term URL whenever someone make a search.

eg, if the Search term is “hello”, the search URL should be

yourdomain.com/?s=hello&post_type=product

What code should I add to make these changes?

0
Jinson 2 months 2021-06-02T15:56:37-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse