Title: Listing posts in groups
Last modified: August 18, 2016

---

# Listing posts in groups

 *  [eightdotthree](https://wordpress.org/support/users/eightdotthree/)
 * (@eightdotthree)
 * [21 years, 1 month ago](https://wordpress.org/support/topic/listing-posts-in-groups/)
 * On my archive pages I need to list the content in category groups. In order to
   do that I use “rewind_posts();” and run multiple loops like the one below.
 * `
    while (have_posts()) : the_post(); if (in_category('8')) { include "includes/
   post.php"; }  endwhile;
 * Now, when there is no content in that category it is an empty space. And if I
   do an else statement in my if(in_category(‘8’)) conditional I get as many lines
   as there are total posts.
 * Is there a way for me to say, if there are no posts in a category, to display
   a message?
 * [Example](http://www.beta2.incrediblythin.com/2004/09/)

The topic ‘Listing posts in groups’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [eightdotthree](https://wordpress.org/support/users/eightdotthree/)
 * Last activity: [21 years, 1 month ago](https://wordpress.org/support/topic/listing-posts-in-groups/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
