list posts by category inside the loop
-
I’m trying to figure out a way to group my posts by categories. So far I have a page that displays about 14 posts, ordered by category, ascending. I want to display the category title for each category group, so basically separate them with a title.
I want to be able to accomplish this within my current code, here is a sample:
query_posts('showposts=' . $limit . '&cat='.$blogCategoryIdStr . '&orderby=category'); if(have_posts()) { ?> <?php while(have_posts()) { ?> <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?> </a></h3> <p><?php the_content ?></p> <?php } } ?>
This is a simplified version of my code but hope it makes sense.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘list posts by category inside the loop’ is closed to new replies.