开发者

WordPress: Number of posts by author

How can I show how many posts an author has made on a WordPress site?

e.g.

<div class="avatar-card-content">
    <h3><?php echo ge开发者_开发知识库t_the_author(); ?></h3>
    <ul class="clearfix">
        <li>0 <span>Posts</span></li>
    </ul>
</div

What would I put in the place of the '0' ?

Thanks


<?php the_author_posts() ?> will do it. From wp-includes/author-template.php

get_the_author_posts() to return the value, the_author_posts() to echo it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜