How to include specific custom post types in WordPress search results

Custom post types are not included in the WordPress search results by default – adding this snippet to you functions.php creates a function that allows specific custom post types to be queried and searched by WordPress.

Instructions
Add this to your functions.php file

Comments

Leave a Reply

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

Snippet Info

Tested with Wordpress v. 4.8
Last Modified: 06.03.2018
Last Reviewed: 06.03.2018

How to include specific custom post types in WordPress search results
5 (100%) 1 vote
Please report broken snippets.
Report Broken Snippet
Web Hosting