Wordpress : How Do I get taxonomy name in taxonomy.php?

James picture James · Jul 31, 2010 · Viewed 31.7k times · Source

I am able to display the term of the taxonomy in the taxonomy page, but how do I get the taxonomy , or display the taxonomy on the page.

for example, when I have a taxonomy called "fruit" and I click on a fruit term called "lemons", How do I display both "lemons" and "fruit" on the taxonomy term page?

Just looking for the get term equivalent. Thx!

Answer

Kiran Raj Pradhan picture Kiran Raj Pradhan · Aug 6, 2013

A possible solution:

$taxonomy = get_queried_object();
echo  $taxonomy->name;