Search a category

This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 8 years ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #9422
    Jimtowner
    Jimtowner
    Participant

    Is there a way to constrain searches so that the search is only in a category id that I have specified?

    #9427
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    There are 2 possible solutions:

    1. The plugin was suited to an exclusive basis, so there is an option to exclude all other categories, and leave only the one you need. You can do that on the Advanced Options -> Exclude results panel, with the Exclude posts by categories option.

    In this case however you will always have to exclude new categories after creation, which might be a bit inconvenient.

    2. Another solution is to put the following code to the functions.php file in your current theme directory:

    All you need to do is change the $category_id variable to the category ID you need.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #9430
    Jimtowner
    Jimtowner
    Participant

    Excellent. I think I’ll try the Exclude option for now but good to know the custom code is available. Thank you again!

    #9436
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Search a category’ is closed to new replies.