The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

How to put latest post in a separate Div to other posts (6 posts)

  1. Kanger
    Posted 5 years ago #


    I am displaying post excerpts on page and I wish the latest excerpt to be in a separate div that I can style and position (basically I want most recent post excerpt to be above a ribbon banner on page and rest of post excerpts to be below that banner).

    Anyone know how to do this?

    Thanks in advance for any ideas

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    This has been answered in one form or another many, many, times. Please try searching the forums before posting.

  3. Kanger
    Posted 5 years ago #

    thanks...I've looked at quite a few...I should have explained in my OP that I'm using excerpts...so I wish layout to look like this

    So think I possibly need to style excerpts not post? Wish to style latest post excerpt differently to older post excerpts.

  4. esmi
    Forum Moderator
    Posted 5 years ago #

    It doesn't matter if you;re using the_excerpt() or the_content(). The approach is identical.

  5. WebTechGlobal
    Posted 5 years ago #

    Yes esmi is correct.

    Kanger what you need to examine is The Loop. The loop is where WordPress loops through all posts or pages.

    Inside the loop, the_excerpt() and the_content() is used.

    There are endless approaches to doing what you need to do but the basic simply requires you to count the number of posts displayed already then after a certain number begin printing different html/styles/div

    Hope that helps to clear it up. Have fun messing around with this part of WordPress it can get interesting.

  6. Kanger
    Posted 5 years ago #

    After searching all the forum posts on this and docs...I found this to be the best and simplest solution...

    hope it saves others time

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.