This code enables you to add the post count before the archive title in Genesis. If you’re not using Genesis, you can use the get_the_archive_title filter. This filter doesn’t work in Genesis because genesis uses get_term_meta to get the name of the archive title.
Here’s the result:
And here’s the Edit Category page where the title is added:
The post count is only added to the Archive Headline which you need to add manually as it’s different from the Name field for each category. The Archive Headline field is generated by a custom function added in Genesis and not included in WordPress.
The code will dynamically update the post count for every category and display it before the category archive page title on all category archive pages. You’ll also find code which enables you to print the posts count for any taxonomy or term.
Here’s the code for logged in members:
Was This Tutorial Helpful?