I'm trying to return only pages in search results.
This is working:
It returns only posts, no pages.
But the opposite is not working:
This is returning pages and posts.
How do I return only pages?
Forgot to mention, so I'm trying to allow the ability for the user to click two links at the top of the search results page.
<a href="/?s=term&post_type=post">Search Only Posts</a> <a href="/?s=term&post_type=page">Search Only Pages</a>
So, I can't just globally set all search results to only be one or the other.