Predefine a category in the search widget

This topic contains 1 reply, has 2 voices, and was last updated by  Alex Rollin 4 years, 8 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: ,

  • Author
    Posts
  • #542028

    stewak
    Expired Member

    I would like to have the category option in a search widget preset at a certain category or failing that have the first option set as the category I want that is relevant for that page.

    Example:
    I have an Accommodation CPT
    Catergories for this are : Self Catering, Holiday Cottages, Pub Accommodation

    I have a page that is for Self Catering and have added a GD map and GD Listings that only show the listings with the Self Catering category. I want a search box on this page that will only search the Accommodation that are set to the categoy self catering.
    Is this possible and if not is there a way to set the cateogry choice on the standard GD search to already be set at the Self Catering Category.?

    #542036

    Alex Rollin
    Moderator
    Post count: 27815

    This happens automatically with the category select dropdown in the search bar on CPT + Category pages. It would require your own code to make it work on other WP Pages.

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount