• I’ve only found one link to someone addressing this and the site is down! cruel fate…

    I may be wording this wrong in my searches, but I want the last post that is displayed on my page (or the last two posts, etc) to be styled in a way differently than the rest.

    The problem is that there could theoretically be any number of posts on a page, (theres a page for job listings which could list only one or even none and a page for employees so the number of posts that are employee bios will continually grow) so i cant say style post 10 like so, etc etc

    I’ve found how to style the last post (being the most recent or latest post) but no way to style a position in the line thats relative to the number of posts listed.

    anyone know how to do this, or where to look?

    Thanks so much!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Can’t remember where I saw this:

    lastest post in the current page of posts
    if( ($wp_query->current_post + 1) < ($wp_query->post_count) ) {
    echo(“<hr />”);
    } else {
    echo ‘this is the lastest post in the current page of posts’;
    }

    Just what I needed. Thanks!

    Anyone else looking for more detail can find info on the Role of WP_Query page.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘style the last post listed on a page’ is closed to new replies.