【问题标题】:how many post author do want to show it author box有多少帖子作者想向它展示作者框
【发布时间】:2012-11-08 15:06:03
【问题描述】:

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

/***** 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; }

【问题讨论】:

    标签: html wordpress wordpress-theming


    【解决方案1】:

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

    有一个函数叫做the_author_posts()(Codex)

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

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

    可以翻译类似的东西

    <p>Firstname Lastname has blogged 213 posts</p>"
    

    【讨论】:

    • 我在哪里得到循环?在哪里?
    猜你喜欢
    • 1970-01-01
    • 2012-02-08
    • 1970-01-01
    • 2020-11-28
    • 2021-04-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-02-05
    相关资源
    最近更新 更多