Needed this for my custom taxonomy for code snippets, when navigating via the tags of my non-regular taxonomy/category terms.
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?>
I stuck this in to my ‘archive.php’ file in my theme (after line 30)
<?php } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?> <h1>Blog Archives</h1> <?php } else { $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); // HACKED in for custom taxonomy titles.?> <h1>Posts Tagged "<?php echo $term->name;?>"</h1> <?php } ?>
Note it just has an ‘else’ at the end since I don’t know what it should be specifically – may cause problems down the line but seems OK for now.
SeeĀ http://stackoverflow.com/questions/2805879/wordpress-taxonomy-title-output
Tech Reference: WordPress
Leave a Reply