How to Customize Search Results by Post Type?

The search results template is used to display a visitor’s search results.

Customize Search Results by Post Type

To include search results for your custom post type add an input to your search form with a name of post_type -

<input type="hidden" value="product" name="post_type">

You can customize the search results by changing the post_type value. Right now it is set to display product but you can modify it to display anything you want.

If you face any problems or need our professional services, please email us at [email protected].

Join our Newsletter

Never miss the latest offers, voucher codes and useful articles delivered weekly in your inbox.