WordPress.org

Ready to get started?Download WordPress

Forums

Listing posts in groups (1 post)

  1. eightdotthree
    Member
    Posted 9 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags