最新公告
  • 欢迎您光临知事网软件APP资源下载站,一个优质的手机App应用商店和网站源码基地。欢迎加入永久SVIP
  • WordPress函数get_the_author_posts()用法 获取当前作者文章总数

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

    描述:

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

    用法:

    <?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()用法 获取当前作者文章总数

    发表评论

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

    [!--temp.right--]
    请选择支付方式
    ×
    余额支付
    ×
    微信扫码支付 0 元