The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

Multiple Custom Search pages

  • # October 3, 2012 at 3:31 pm

    How would I go about having 5 search pages on my site, each of which searches within a different category?

    I know I would use this in my functions.php if I wanted the search functionality on the whole site to only search specific categories.

    function SearchFilter($query) {
    if ($query->is_search) {
    // Insert the specific categories you want to search
    $query->set(‘cat’, ‘8,9,12’);
    return $query;


    Or is the answer to only return or echo the results from certain categories?

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed