简体   繁体   English

如何在wordpress中获取所有帖子作者姓名

[英]How To Get All post author name in wordpress

I trying to get all post author name how can I get all post author name in wordpress . 我试图获取所有帖子作者姓名,如何在wordpress中获取所有帖子作者姓名。 can I get all author name who write at least one post and their permalinks 我能得到所有写至少一篇文章的作者姓名和他们的永久链接吗

You can use list author WordPress function 您可以使用列表作者WordPress功能

<?php $args = array(
'orderby'       => 'name', 
'order'         => 'ASC', 
'number'        => null,
'optioncount'   => false, 
'exclude_admin' => true, 
'show_fullname' => false,
'hide_empty'    => true,
'echo'          => true,
'feed'          => [empty string], 
'feed_image'    => [empty string],
'feed_type'     => [empty string],
'style'         => 'list',
'html'          => true,
'exclude'       => [empty string],
'include'       => [empty string] ); ?> 

 <?php wp_list_authors( $args ); ?> 

hide_empty (boolean) Do not display authors with 0 posts. hide_empty(布尔值)不显示具有0个帖子的作者。 Valid values: 1 (true) - default 0 (false) 有效值:1(true)-默认值0(false)

Know more about this https://codex.wordpress.org/Function_Reference/wp_list_authors 进一步了解此https://codex.wordpress.org/Function_Reference/wp_list_authors

Seems like wp_list_authors would get you that. 似乎wp_list_authors可以帮到您。 More details in the codex . 更多细节在法典中 By default it excludes users with no posts. 默认情况下,它排除没有帖子的用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM