Determine last post on a page
-
I’m trying to style the last post on the page differently from others in a template (so as to have a “footer” that won’t try to blend into the next nonexistent post), but I can’t find any way of determining what the last post on the page is. I’ve tried checking the return of have_posts(), but it resets the whole thing if I query it after the last the_post() call (it goes into an infinite loop).
I’ve heard suggestions to use get_option(‘posts_per_page’), but if I have fewer posts on the site than the maximum posts_per_page (if it’s 10, for instance, but my page only has 3 posts), that still returns the maximum, not the actual.
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Determine last post on a page’ is closed to new replies.