最新公告
  • 欢迎您光临站盟网(原知事网),一个优质的网站源码基地、精品网站模板和插件。欢迎加入永久SVIP
  • WordPress函数get_the_author_posts()用法 获取当前作者文章总数

    正文概述 知事网   2020-09-11 09:09   564

    描述:

    获取当前作者/用户发布的文章总数

    用法:

    <?php echo get_the_author_posts(); ?>

    源文件:

    /**
    * Retrieve the number of posts by the author of the current post.
    *
    * @since 1.5.0
    *
    * @return int The number of posts by the author.
    */
    function get_the_author_posts() {
    $post = get_post();
    if ( ! $post ) {
    return 0;
    }
    return count_user_posts( $post->post_author, $post->post_type );
    }

    站盟网 » WordPress函数get_the_author_posts()用法 获取当前作者文章总数

    发表评论

    还没有评论,快来抢沙发吧!

    如需帝国cms功能定制以及二次开发请联系我们

    联系作者
    请选择支付方式
    ×
    支付宝支付
    微信支付
    余额支付
    ×
    微信扫码支付 0 元