Taxonomy title
-
How do I output the title of a taxonomy? Currently, for a tag, I have the following code in my archive page…
<?php if (is_tag()) { ?> <h1><?php single_cat_title(); ?></h1> <?php } ?>
I have something similar for taxonomies, as follows…
<?php if (is_tax)) { $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); ?> <h1><?php echo $term->name; ?></h1> <?php } ?>
The above works fine, but is not quite what I want. For example, I have a taxonomy called Release Dates (for year of release of movies I’ve reviewed).
The above outputs, for example: 2011 for the title. But I’d like it to say: Release Date: 2011.
Is there any way of putting the name of the taxonomy in front like that? I also have a taxonomy called Actors. So I’d also like that to read: Actors: [actor name].
Hope this makes sense.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Taxonomy title’ is closed to new replies.