WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Kanger
    Member
    Posted 2 years ago #

    Hello

    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
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    This has been answered in one form or another many, many, times. Please try searching the forums before posting.
    http://wordpress.org/search/re-style+first+post

  3. Kanger
    Member
    Posted 2 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
    Theme Diva & Forum Moderator
    Posted 2 years ago #

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

  5. WebTechGlobal
    Member
    Posted 2 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
    Member
    Posted 2 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

Tags

No tags yet.