litiming the search scope based on page
-
im making a classifieds site.
I want the search bar to search the current scope.
if your in a taxonomy, only search that taxonomy.
if your in a post archive only search this post archive.
if your in a taxonomy term, only search taxonomy term.I dont think i can use pre_get_posts for this. I need to know what page they are currently on.
would this work?
<input type=”hidden” name=”post_type” value=”<?php echo $variable ?>” />
and the variable gets the post type or the taxonomy….
- The topic ‘litiming the search scope based on page’ is closed to new replies.