Echo Current Custom Taxonomy Term

Use the WordPress function on a custom query on a custom template.

echo get_queried_object()->name;

single:

$terms = get_the_terms( $post->ID, 'eventtype' );
foreach ( $terms as $term ) {
	echo $term->name;
}

Or this can be used on taxonomy.php

echo $wp_query->queried_object->name;

Leave a Reply

Your email address will not be published. Required fields are marked *

+ 16 = 19