Displaying individual and total number of posts
I wish to add a post number and then a total number of posts in each post written, i.e.
= “This is test message 1 of 5” where the 1 is the post number and the 5 is the total number of posts.
I understand that mySQL gives each post a unique ID which can be displayed using <?php echo $post->ID; ?> but this is always increasing even if posts are deleted.
I wish to reassign a post with the number 1 even if it it is post 33 and all of the other posts have been deleted, is there a widget or some php code that could check for non-deleted posts in a category and assign them a number always starting from 1 (with 1 being the oldest)?
Then display this number in the post head or body along with the total number of non-deleted posts in this category?
Then when a new post is added the process is started again so post 1 is now post 2 etc
- The topic ‘Displaying individual and total number of posts’ is closed to new replies.