我正在使用最新的wordpress和buddypress版本 . 我想在作者 Profiles 页面上显示作者的帖子,以实现这一目标 . 我将members / single / profile.php复制到mytheme / buddypress / members / single / profile.php
然后我添加此代码片段
do_action('bp_after_profile_content')
<?php
$args = array( 'author' => bp_displayed_user_id(),
'post_type' => 'post'
);
query_posts( $args );
if ( have_posts() ) : while ( have_posts() ) : the_post();
get_template_part( 'content', $theme_options['post_layout'] );
endwhile; else:
echo ('no posts found so do something less amazing');
endif;
?>
我得到的结果是每个帖子的重复,第一个是exceprt,然后是完整的帖子 . 我只想在会员资料页面上显示每个帖子的摘录 . 请看这个 . http://bit.ly/1mEbj0G
我正在使用最新的wordpress和buddypress版本 .
1 回答
如果是这是一个 Profiles 页面,那么你会想把它放在这里 .
这是我正在使用的精简版 .