Created
January 8, 2016 02:12
-
-
Save susanlangenes/e53d173a08c51a33682f to your computer and use it in GitHub Desktop.
Display post count for a taxonomy term. Nice for archive templates.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// this will output like so: Taxonomy Term Name (19) <- where '19' is the number of posts with that taxo term. | |
?> | |
<h1 class="page-title"> | |
<?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?> | |
(<?php global $wp_query; | |
echo $wp_query->found_posts; ?>) | |
</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment