Support » Fixing WordPress » Searching and displaying results from ONLY one cat

  • hi yall. im having a problem doing this. here is the code i have as of now.
    <li id=”search”>
    <label for=”s”>Search:</label>
    <form id=”searchform” method=”get” action=”/reviews.php”>
    <input type=”text” name=”s” id=”2″ size=”15″ />
    <input type=”submit” name=”submit” value=”Search” />
    <input type=”hidden” name=”cat” value=”2″ />
    i am trying to do a second page with wordpress and only show one catagory on it.
    I want to only search catagory 2 and its sub catagorys. As of now, i can search , but when i hit somethign that has a result, it bring me back to my main page showing posts from cat 1 which is not what i want.
    i want to NEVER show posts from anything but cat 2.
    any ideas?

Viewing 1 replies (of 1 total)
  • my guess is the search code ignores the category restriction thingy. you might want to look in wp-blog-header where the search string is processed/used, and maybe allow through category filtering.
    HOWEVER, if you want to do that, I’d suggest changing ‘cat’ to ‘searchcat’, and writing some new code to grab $searchcat from the post vars. That would be cleaner integration with stuff.
    Just off the top of my head…

Viewing 1 replies (of 1 total)
  • The topic ‘Searching and displaying results from ONLY one cat’ is closed to new replies.