Quote:
Originally Posted by Sarah_MaxCash
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; ?>