Return all Tags from search results
The global $wp_query object is available before you call have_posts(). All you have to do is running through this object’s posts member with get_the_terms(). Sample function: function get_query_terms( $taxonomy = ‘post_tag’ ) { $list = array (); foreach ( $GLOBALS[‘wp_query’]->posts as $id ) { if ( $terms = get_the_terms( $id, $taxonomy ) ) { foreach … Read more