我有以下代码来列出他们创建的成员的帖子。然而,它列出了所有帖子。有人知道怎么修吗?非常感谢。
<?php
if ( is_user_logged_in() ) {
global $current_user;
get_currentuserinfo();
echo \'User ID: \' . $current_user->ID . "\\n";
$args=array(
\'member\' => $current_user->ID,
\'post_type\' => \'listing\',
\'post_status\' => \'publish, private\',
\'posts_per_page\' => \'10\'
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo \'Your Posts\';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
}
?>