• Resolved altstatten

    (@altstatten)


    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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter altstatten

    (@altstatten)

    No takers?

    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.

    Thread Starter altstatten

    (@altstatten)

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘“Most Recent Posts” and COLOR’ is closed to new replies.