Reply To: How to pass/get the ID of the page where the search is placed?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support How to pass/get the ID of the page where the search is placed? Reply To: How to pass/get the ID of the page where the search is placed?

#11119

Ernest Marcinko
Keymaster

Hi!

If I'm guessing correctly you only want to return the pages from the same category as the currently displayed page is in.

In that case something like this could do the trick:

This will get the current post/page categories and push them to the query arguments.

In case you have posts/pages which are uncategorized, you might want to turn OFF an option to exclude them as well: https://i.imgur.com/Rnuslom.png

Best,
Ernest Marcinko

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