Make WP search pickup results in pages that query their content from custom post types

I have a simple scenario that works well for organizational purposes, but that does not play well with stock wordpress search:

I have content in a custom post type (say, a directory of people), and these people are displayed on a Page, that queries the custom post type and displays it in a list. Now, the custom post types do not have their single pages displayed on the site at all. All the ‘people’ content is only displayed in an ‘About us’ page that displays it’s own content and title, and that also queries the ‘people’ custom post.

Question is: how to make wordpress search for people terms and land visitors on the About page instead of suggesting the single ‘people’ pages that should normally be hidden?

The way I am making it work now is by using a redirect from the single_people page to the About page, but I looks hacky and causes extra http requests. I could use an archive template for that but I will lose the About page’s content from it’s the_content()…

Any suggestions?

Read more here:: Make WP search pickup results in pages that query their content from custom post types

Leave a Reply

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