View Single Post
Old 06-16-2010, 06:07 AM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,289
Quote:
Originally Posted by Sarah_MaxCash View Post
Is there one where certain posts can be excluded from the rotation? For example, I may have some posts that were pretty time specific and themed towards past current events. I want to rotate posts but not those. Anybody know a WP plugin that will do that?

Thanks!
I would do a custom loop and exclude those posts, although their might be a plugin for this.

Code:
// 1,2,3,4 are post ids.

<?php $args = array('orderby' => 'rand','showposts'=>5,'post__not_in'=>array(1,2,3,4));?>

<?php $custom = new WP_query($args);?>

<?php if ($custom->have_posts()) : ?>
<?php global $wp_query; $wp_query->in_the_loop = true; ?>
<?php while ($custom->have_posts()) : $custom->the_post(); ?>

<a href="<?php the_permalink() ?>"><?php the_title(); ?></a>

<?php endwhile; ?>
<?php endif; ?>
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote