[Resolved] Get pount position in total post count
Just wondering if anyone knew how to grab the post position within a total post count?
That probably doesn’t make much sense LOL
Basically, I’m trying to do *almost* what the WP Page-Navi plugin does. (That sucker comes in very close!) I’m setting up the blog to display one post at a time. At the bottom, where the “Next Previous Post” links are, instead I want « Previous Posts (X of Y). “X” would be the current post and “Y” the total count of published posts for the site. So if we’re on the most recent post out of 264 posts on the site, the index page would display “« Previous Posts (1 of 264)”
Now, I’ve had no problem getting the *total* count – that’s dead easy.
$numposts = wp_count_posts(‘post’);
That gives me the total number of posts that have been published on the site. I’m just having a time trying to figure out how to get the *current* post’s position in the count. I’m thinking I could somehow grab what page number I’m on, since I’m only showing one single post at a time – but if I did that thenI might as well use the WP Page-Navi plugin. The problem with *that* is that the formatting/layout of the WP Page-Navi plugin isn’t correct, and it just seems like an awful lot of code for one single thing. (seems I could write a simple unction for this, rather than use a plugin – I don’t know, maybe I’m overthinking this.)
Anyone feel like kicking me in the teeth with an idea? (even if it is “shut up and use Page-Navi” – of course then I’ll have to try and figure out how to alter the output without altering the core files)
- The topic ‘[Resolved] Get pount position in total post count’ is closed to new replies.