0

我想要我的网站在所有帖子作者框中显示的任何作者有多少帖子。我怎么能点它。我的作者框 css 代码如下所示。我的网站

/***** Author Box *****/
.post-gravatar { position: relative; width: 60px; height: 60px; margin: 0 10px 0 0; float: left; }
.post-gravatar img { display: block; width: 50px; height: 50px; border: 1px solid #d9d9d9; background: #fcfcfc; padding: 4px; }
#author-box, #archived-author-box { position: relative; width: 598px; margin: 0 15px 25px; background: #f1f1f1; border: 1px solid #d9d9d9; padding: 10px; }
#author-box h3 { color: #222; font-size: 1.1em; margin: 0 0 10px; text-transform: uppercase; }
#author-text, #archived-author-text { position: relative; width: 528px; float: right; }
#author-text p { font-size: 1.2em; line-height: 1.6em; margin: 0 0 10px; }
#archived-author-text p { font-size: 1.2em; line-height: 1.6em; }
#author-text p a, #author-text p a:visited,
#archived-author-text p a, #archived-author-text p a:visited { text-decoration: none; }
#author-text p a:hover, #author-text p a:active,
#archived-author-text p a:hover, #archived-author-text p a:active { text-decoration: underline; }
4

1 回答 1

0

你想显示每个作者写过的帖子数吗?

有一个名为the_author_posts() (Codex)的函数

例如,在您的循环中,您可以像这样使用它:

<p><?php the_author(); ?> has blogged <?php the_author_posts(); ?> posts.</p>

可以翻译类似的东西

<p>Firstname Lastname has blogged 213 posts</p>"
于 2012-11-08T07:06:03.553 回答