Normal search is working fine, but I need to search based on category in wordpress.
For eg..
say I have two category named as ‘Car’ and ‘Bus’, if I choose CAR category then search should display results form CAR category and if I have choose BUS category then search should display results from Bus category.
As of now am using this code
<?php wp_dropdown_categories('show_option_all='.__('All Categories', 'appthemes').'&hierarchical='.get_option('cp_cat_hierarchy').'&hide_empty='.get_option('cp_ cat_hide_empty').'&depth='.get_option('cp_search_depth').'&show_count='.get_option('cp_cat_ count').'&pad_counts='.get_option('cp_cat_count').'&orderby=name&title_li=&use_desc_for_tit le=1&tab_index=2&name=scat&selected='.cp_get_search_catid().'&class=searchbar&taxonomy='.AP P_TAX_CAT); ?>
This code am using in Classipress Theme
Thanks
Shobhit
There are several ways to achive this you have to replace the standard WordPress search form in searchform.php with the code below .
This will enable search based on categories .