Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm creating a site similar to http://thegreatdiscontent.com/ in that there's a bunch of posts on the site, and only one post gets shown per page.

I want to add a counter that says something like: "Issue #210" at the top of each post, as they have done with http://alistapart.com/. This would increment with each new post.

I've seen it out there to use wp_query->current_post, but that only works when you run through a loop. I'm only showing one post per page, so wp_query always returns 0.

Any ideas how I can make my posts increment?

Thanks!

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The one persistent numerical thing about post is ID, however it is sequential for all posts, so you will have gaps if using it.

It would be easiest to assign a number and store it in custom field on post creation. Probably take it from an option and increment it there, so that your numbering doesn't shift if you delete a post and such.

share|improve this answer
    
Good call. In the time it would take me to add this custom field every week or two, it would be no big deal. Good advice. –  saltcod Jun 13 '13 at 22:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.