In archive-news.php, i've tried
global $wp_query;
$tax = $wp_query->get_queried_object();
echo $tax->name;
But this gets the taxonomy, not the taxonomy term.
I need to print the tax term name for each entry on the archive page which lists posts in the custom post type.
In archive-news.php, i've tried
global $wp_query;
$tax = $wp_query->get_queried_object();
echo $tax->name;
But this gets the taxonomy, not the taxonomy term.
I need to print the tax term name for each entry on the archive page which lists posts in the custom post type.
Share Improve this question asked Jun 16, 2020 at 7:08 Brad DaltonBrad Dalton 6,9652 gold badges36 silver badges47 bronze badges1 Answer
Reset to default -1wp_get_post_terms did the trick