wphats

How to include custom post type in Search Results

How to include custom post type in Search Results

By default in WordPress, the search results shows for pages & defualt post types. So if you create any custom post type it doesn’t include automatically.

The the_search_query filter helps you to include your custom post types in search results. Just copy and paste the below code by renaming your post_type in your theme functions.php file.

 

This post has already been read 1256 times!

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

More Posts

POSTED ON: Wordpress Support
TAGGED : ,

One thought on “How to include custom post type in Search Results”

Leave a Reply

Your email address will not be published. Required fields are marked *