$obj = get_queried_object(); if( isset($obj->taxonomy)){ $terms = get_terms( $obj->taxonomy ); if ( $terms && ! is_wp_error( $terms ) ){ echo ''; } }