How to show recent post, but exclude any author post. First of all you need to know the user id of the author that you want to exclude.
<?php query_posts('author=-17&showposts=7'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile;?>
This will show 7 recent post excluding posts from author with user id 7.
To exclude more than one author:
<?php query_posts('author=-17&author=-8.....&author=-19&showposts=7'); ?>
<?php while (have_posts()) : the_post(); ?>
<li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
<?php endwhile;?>
This will exclude all those authors mentioned.
Keep checking for more WordPress tricks
July 17, 2010 at 5:28 pm
learned a lot