这是我的密码。它显示了100个被称为活动的自定义帖子。我需要它只显示当前用户。所以作者/乔应该只展示乔的竞选活动。
<?php
if(isset($_GET[\'author_name\'])) :
$curauth = get_userdatabylogin($author_name);
else :
$curauth = get_userdata(intval($author));
endif;
?>
<h2>Campaigns by <?php echo $curauth->nickname; ?>:</h2>
<?php
$args = array(
\'posts_per_page\' => 100,
\'post_type\' => \'campaigns\'
);
query_posts($args);
if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<li>
<a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>">
<?php the_title(); ?></a>,
</li>
<?php endwhile; else: ?>
<p><?php _e(\'No posts by this author.\'); ?></p>
<?php endif; ?>