This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Search a category

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

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

    #9427
    Ernest MarcinkoErnest 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.

    #9430
    JimtownerJimtowner
    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 MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Search a category’ is closed to new replies.