Get the number of posts written by specific user in WordPress page

I’m trying to make an author page in my WordPress blog. I have one thing that I try all the way and didn’t make it.

I want to display the number of the posts from each author, but I can’t make that just use <?php the_author_posts(); ?> because I’m not in a single.php file.

Read More

So far I know I have to use the <?php echo get_the_author_posts(); ?>, but that didn’t work either because I can’t specify what the author ID is. So I tried something like that: <?php echo get_the_author_posts( $id_ir_email = '1'); ?>, didn’t work either.

Any idia how to resolve that?

In resume, I just want to write “Admin has written X posts on this blog” outside the single.php

Related posts

Leave a Reply

1 comment

  1. Not sure if this helps or not but I created a blog page where i wanted posts from a specific author:

    // Reset Query because I had already done a query on the page.
    wp_reset_query();
    
    // The Query for a specific author
    query_posts('author=4'); 
    

    Info from this page.

    Using this you could loop through and count the posts.