Get posts count of current author


Most of the times we need to display the number of posts written by current post author.

In WordPress, We can use the function get_the_author_posts() to display the posts count.


You can use it in the single post, page, or custom post type template.


You can also use display the post count with custom shortcode like below:


add_shortcode( 'author_post_count', function() {
    return get_the_author_posts();

Here, We have created a shortcode [author_post_count] which display the current post author posts count.

Leave a Reply