使用允许用户相互跟踪的第三方插件,我们可以像这样检索被跟踪的用户(评论):-
<?php if (have_posts()) : ?>
<?php global $userpro_social;
$following = $userpro_social->following( get_current_user_id() ); //get users the current user is following
print_r($following) ?> // print the array so we can see who we\'re following
<?php $paged = get_query_var( \'paged\' ) ? get_query_var( \'paged\' ) : 1; ?>
<?php query_posts( array( \'author\'=> ??? , \'paged\' => $paged, ) ); ?>
<?php while ( have_posts() ) : the_post() ?>
<?php if ( has_post_format( \'video\' )) {
get_template_part( \'video-post\' );
}elseif ( has_post_format( \'image\' )) {
get_template_part( \'image-post\' );
} else {
get_template_part( \'standard-post\' );
}
?>
<?php endwhile;?>
<?php endif; ?>
所以这会输出这样的结果阵列([24]=>1[1]=>1)
ie,我们正在跟踪ID为1和24的用户,是否足够简单?
我迷路的部分是
<?php query_posts( array( \'author\'=> ??? , \'paged\' => $paged, ) ); ?>
我如何实际输出这些用户的帖子,它已经存储在数组中,所以我认为这应该很容易,但我只是无法理解,即使在阅读了抄本之后。