Search current category
-
This is part of my current search code:
<?php function wp_search_form($form) { $form = '<form method="get" id="searchform" action="' . get_option('home') . '/" > '.wp_dropdown_categories('exclude=1 Categories&hide_empty=0&echo=0&selected='.intval($_GET['cat']).'').' <input type="text" class="search_input" value="' . attribute_escape(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" /> <input type="submit" alt="Search" class="greybutton float_right" value="Search" /> </div> </form>'; return $form; }
I want to get rid of the dropdown and instead just search the category the user is in at the moment. If the user is a the frontpage they will get to search all categories. If the user is in say the category with the id “3” they will only get results from that category. How do I go about that?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Search current category’ is closed to new replies.