Search within a directory ? (or only pages with a specific tag?)

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search within a directory ? (or only pages with a specific tag?)

This topic contains 2 replies, has 2 voices, and was last updated by everbeta everbeta 6 years, 5 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #15674
    everbeta
    everbeta
    Participant

    Hello,

    I have a general question, but can supply login details if needed. I would like to know if I can set up a custom search on this page to search only sub-pages within this directory : http://mather.wpengine.com/care-treatment/

    The goal for the search on this page would be to only search pages within the “Care & Treatment” section, excluding other pages of the site (as well as any posts). Would these pages need to be changed to posts or custom post types in order to do this? Or would I be able to add a tag to all pages which I want to be included within results (ie “care & treatment”?) – would this work with the index ?

    Thanks!
    Colin

    #15676
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Colin,

    It depends on how the current page structure is defined. If the ‘Care & treatment’ page is actually the parent page of the pages you need to search, there might be a really easy solution: Knowledge Base – Limiting results to specific posts by parent ID

    Another possibility is to enable categories to pages (or any other taxonomy) and then only include the category you want the results from.
    To have categories with pages, there are multiple plugins available, for example: Post tags & Categories for pages

    Best,
    Ernest Marcinko

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


    #15682
    everbeta
    everbeta
    Participant

    Awesome, thanks !

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

You must be logged in to reply to this topic.