can be done superdupereasy with:
<?php echo get_queried_object()->name; //output $taxonomy->$tax the simple way ?>
name
, when beeing on some custom taxonomy page, will be the taxonomy term., e.g. on something like example.com/books/Fiction
, this will echo fiction
.
Instead of name
you could also use taxonomy
, which will echo books
.
And shortly spoken, taxonomies are NOT categories or pages or comments, they are something you declare, like "products" or "books". Using that you unlock WordPress'es Custom Post Type functionality. You can make your own archive-products.php
, page-products.php
, single-products.php
and have big fun with it. :)