Filter search results from categories
-
On my search page there is a column that displays all the categories and the amount but when you click on the category it takes your to the archive page. What I am trying to achieve is that when you click on the “news” category for example it would only display results from the news category.
Not entirely sure on the best way of doing this would the search term & category have to be appended into the url and then do a page refresh?
This is how I am displaying the categories at the moment:
<ul class="categories"> <?php $args = array ( 'echo' => 0, 'show_count' => 1, 'title_li' => '', 'depth' => 1 ); $variable = wp_list_categories($args); $variable = str_replace ( "(" , "<span>", $variable ); $variable = str_replace ( ")" , "</span>", $variable ); echo $variable; ?> </ul>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Filter search results from categories’ is closed to new replies.