Display Only 1 post per custom taxonomy?
-
Hello, I’ve got a quick question…
I’ve got a loop that is displaying posts with custom taxonomies….is there a way to only display 1 post from each taxonomy?
Can anyone help me?
See my code below:
<?php $args=array( // avoid duplicate posts post__not_in => $ids, taxonomy => 'session', term => 'rhythm-and-roots-2010', // PAGANATION FIX paged=>$paged, ); query_posts($args); if (have_posts()) : echo '<div id="mydiv"> <ul id="mylist">'; $count = 0; while (have_posts()) : the_post(); $count++; echo'<li id=mylist-'.$count.'>'; $ids[] = get_the_ID(); ?> <span> <h2><?php the_title();?></h2> <p><?php the_excerpt(); ?></p> </span> <?php echo'</li>'; endwhile; echo '</ul><!– //mylist –></div><!– //mydiv –>'; endif; ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Display Only 1 post per custom taxonomy?’ is closed to new replies.