Displaying Posts with Custom Taxonomies
-
Hello, I’ve got a quick question…I haven’t been able to get an answer on this, I’m hoping that posting it here will help.
I’ve got a loop that is going through my categories and displaying posts with a custom taxonomy ‘session’ called ‘session1’….is there a way to limit this by only 1 post per category?
Can anyone help me? Please!? I’m begging here ??
ThanksSee my code below:
<?php $args=array( // avoid duplicate posts post__not_in => $ids, taxonomy => 'session', term => 'session1', // 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 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Displaying Posts with Custom Taxonomies’ is closed to new replies.