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 6 years, 5 months ago.
- AuthorPosts
- November 29, 2017 at 5:31 pm #15674
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!
ColinNovember 29, 2017 at 9:11 pm #15676Hi 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.
Best,
To have categories with pages, there are multiple plugins available, for example: Post tags & Categories for pages
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
November 30, 2017 at 9:04 pm #15682Awesome, thanks !
- AuthorPosts
You must be logged in to reply to this topic.