Show matching categories in search page
Essentially what you need is show the categories the current queried posts belong. I’ll post here a function that take as argument a taaxonomy (or an array of taxonomies) and return all the terms in that (those) taxonomy(ies) that are assigned to all queried posts. function queried_posts_terms( $taxonomies=”category” ) { global $wp_query, $wpdb; if ( … Read more