Show Number Of Posts Before Archive Page Title

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:

before-archive-title

And here’s the Edit Category page where the title is added:

archive-headline

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?

Free

$0

Access only to all free tutorials per month.



Monthly

$75

Access to 10 premium tutorials per month.


Tutorial Request


Includes code guarantee and coding support.

Yearly

$500

Access to 15 premium tutorials per month.


Monthly Tutorial Request


Includes code guarantee and priority coding support.