• Resolved lukemv

    (@lukemv)


    I have a category listing that simply lists the excerpts with thumbnails and summary, but I want to style it up a bit more.

    What I want to do is separate the most recent post from the category and list it (I’ll do some CSS treatments differently) and then have the rest of the posts listed from the category (minus the most recent post).

    I’ve been able to pull the first one from the current category, but the code has gotten sloppy after countless revisions to make it work. Has anyone already done this?

    Visual:

    Latest Post!
    ——————–
    | POST excerpt 1 |
    ——————–
    Read more!
    – post excerpt 2
    – post excerpt 3
    – post excerpt 4
    – post excerpt 5

Viewing 1 replies (of 1 total)
  • Thread Starter lukemv

    (@lukemv)

    Here is what I came up with… anyone have it more concise?

    <?php $FirstPost = true; ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <?php if ($FirstPost){ ?>
    <!-- DISPLAY FIRST POST -->
    <?php } else { ?>
    <!-- DISPLAY OTHER POSTS -->
    <?php } ?>
    <?php $FirstPost = false; ?>
    
    <?php endwhile;  else : ?>
        <!-- No Posts -->
    <?php endif; ?>
Viewing 1 replies (of 1 total)

The topic ‘Post Listing Design…’ is closed to new replies.