Forums

[resolved] "Most Recent Posts" and COLOR (4 posts)

  1. Altstatten
    Member
    Posted 2 years ago #

    I already have the "Most Recent Posts" set up and showing the latest 5 posts.

    How would I go about getting the LATEST POST to show in a different color?

    Latest Posts

    Post Latest <---This one in color. ??
    Post4
    Post3
    Post2
    Post1

  2. Altstatten
    Member
    Posted 2 years ago #

    No takers?

  3. Sivar
    Member
    Posted 2 years ago #

    Hmm, I'd do it with a count variable. If you put this to a point directly before your loop starts...

    <?php $i = 0; ?>

    ... and the following lines inside of your loop, where it says <div class="post" id=" ... ">...

    <?php if ($i++ == 0) { ?><div class="post-colored" id=" ... ">
    <?php } else { ?><div class="post" id=" ... ">
    <?php } ?>

    ... and create a class ".post-colored" in your style.css with the same settings as ".post" (just with a different color or background-color, whatever you want), it should do the trick.

  4. Altstatten
    Member
    Posted 2 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Topic