Separated Search/Categories – one for Pages, another for Posts?
-
Hi all,
I have a custom site that I’m developing (my first, using a custom theme I’m developing specifically for it), and I need some custom functionality that Google can’t help me with. The site in question has several sections, but there are two we’re focusing on: ‘Work’ and ‘Blog’.
The blog section features just what it says, a blog, with a search field and category filtering – each blog post is a ‘post’.
The work page features work done previously by this company, and it ALSO features a search field and category filtering. Each ‘work’ is a ‘page’.
Here’s the thing: I need these two searches to be completely separate. Searching on the ‘blog’ page should only return blog posts, and searching on the ‘work’ page should only return work. Is there any way to have the two pages call two completely different search results? I know I can exclude pages or exclude posts, but I’ve only been able to do that globally (by putting it in the ‘search.php’ file), not dynamically based on WHERE the user searched from.
In fact, the layout of the search page itself also changes completely based on where the user searched from – the ‘blog’ search looks completely different from the ‘work’ search. It’s almost as if I need two completely different search.php pages.
Any assistance at all would be appreciated!
- The topic ‘Separated Search/Categories – one for Pages, another for Posts?’ is closed to new replies.