Wordpress 返回作者姓名=当前页面标题的帖子

Wordpress 返回作者姓名=当前页面标题的帖子,wordpress,Wordpress,我正在wordpress中为每一位发表文章的作者创建一个个人资料页面。每个页面标题将与作者姓名相等 在这个页面上,我希望能够显示'的内容',这将是一些图像和作者的个人简历后,由他们的6个最新职位 我想做的是创建一个查询,显示作者姓名=标题的帖子 目前,我只展示了我指定的作者(如约翰·史密斯) 您可以使用get_函数获取标题() $author_posts = new WP_Query(); $author_posts->query( array( 'author_name' => g

我正在wordpress中为每一位发表文章的作者创建一个个人资料页面。每个页面标题将与作者姓名相等

在这个页面上,我希望能够显示'的内容',这将是一些图像和作者的个人简历后,由他们的6个最新职位

我想做的是创建一个查询,显示作者姓名=标题的帖子

目前,我只展示了我指定的作者(如约翰·史密斯)

您可以使用get_函数获取标题()

$author_posts = new WP_Query();
$author_posts->query( array( 'author_name' => get_the_title(), 'posts_per_page' => 6) );


while ($author_posts->have_posts()) : $author_posts->the_post(); 

//DISPLAY POST CONTENT

endwhile; 
请参阅此链接以了解有关获取函数的更多信息

$author_posts = new WP_Query();
$author_posts->query( array( 'author_name' => get_the_title(), 'posts_per_page' => 6) );


while ($author_posts->have_posts()) : $author_posts->the_post(); 

//DISPLAY POST CONTENT

endwhile; 

@jogesh\p感谢您通知新来者:)