You can give a try to this within a loop
<?php
echo $wp_query->found_posts - $wp_query->current_post ;
?>
$wp_query->found_posts
gives the total number of posts found matching the current query parameters.
So the if there are 20 posts, result for each post should look like this
For 1st post it will display 20
, i.e. 20-0=20
For 2nd post it will display 19
, i.e. 20-1=19,
…
…
…
For 12th post it will display 9
, i.e. 20-11=9, and
For 20th post it will display 1
, i.e. 20-19=1,
Related Posts:
- How to mark every 3rd post
- Difference between an archive and a page listing posts
- Count posts within a custom post type and specific taxonomy and terms?
- How to Display a List of Users Who Have Made at Least 1 Post?
- How to Display Network Post Count?
- has_archive=false on the default post type
- Clear cache when a post is submitted [closed]
- How to cache a shortcode functions output?
- Create an “All Posts” or “Archives” Page with WordPress 3.0?
- Post Format Archive template name for theme folder?
- Count posts in category including child categories
- widget should display post archive by year and on click also by month
- Count singular post views automatically
- Must permalinks always point to single post pages?
- Set font size automatically according to number of words in post
- At my posts archive page, outside the loop, get_the_id() returns the top most post’s ID
- Display most recent post in category instead of archive?
- Network wide post count (WP Multisite)
- Single.php Active Category Class
- Redirect based on user post count
- Alternate custom content in the loop
- Link for the page archive for posts, like using custom post types with get_post_type_archive_link
- get_post_type_archive_link(‘post’) returns current category archive
- Show that current post is number X out of X
- How to get the latest posting time of archived pages in WordPress?
- Show the author’s count of total amount of posts assign to a custom taxonomy term
- Double count view in archive.php
- change default post archive page link
- Count to how many categories a post belongs to
- Display all months with posts and inside each month show the 5 latest posts
- Display posts from #6 to #20 on archive page
- Count total number across post types
- Count search results in heading
- How to hide first gallery for every post?
- Category List (Archive) Page Template By Category
- Getting category posts from a certain year
- Yearly archive page for future year
- Which URL to enter into browser to show all posts in archive.php?
- Counter of posts ever posted – even deleted ones
- Display Published Posts Count for Certain Time Period
- How to display data in archive page?
- Guest Author – How to display posts on /author/ archive page
- Archiving by academic year instead of calendar year
- How can I get global $post to work for CPT and update user?
- List category posts alphabetically on archive.php
- How to display excerpt post on hamepage and archive pages?
- Increase 10 post limit per page
- Display Notification Bar on Header on Certain Post Count
- Automatically create a new page daily with last three posts
- Show posts count for Categories and Tags in wp_nav_menu
- Archiving posts in wordpress
- How to add category post count in main navigation menu [closed]
- Count number of posts of current month
- Howto show comment count by post in post?
- Counter is skipping post when I still want it visible [closed]
- Custom Post Type archive
- Count several post tags
- Does WP automatically tag posts into the archive?
- Get post number both in the loop and in the post
- How do I insert a after every 5 posts in a WordPress Loop that infinitely loads posts?
- singular posts using archive styling
- Get posts from category from custom query
- Display number of post published every day
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- Alternative content between posts no repetition
- How do I apply a wordpress function to something with no ID inside an archive page?
- count_posts to a standalone link
- Page 2 has no posts?
- How to control Post view count incresing in sidebar widget posts too?
- Disable archiving of old posts?
- is_archive() not working on selected “Posts page”
- How to display term in archive page?
- My posts section for logged in user
- How to organise post by category and date
- Daily posts like an archive
- How to mark every 3rd post
- How to set a link to custom archieve page
- Add a minimum word count to Excerpt (and how to force Excerpt as a rule for WyPiekacz)
- How to get alphabetic listing x other posts, based on first letter post?
- How do I display the next 3 posts in the sidebar?
- How to limit the number of posts a user can publish based on user type
- ho can I get the number of the current post instead of the post id?
- Display all posts from selected month
- How to get pagination working with “Pending” Posts
- Show all posts in category
- custom sort posts in archive/taxanomy page
- post_count not working
- Adding Count Post in Page
- how to show all post with its contents
- Add author section on Author archive posts
- Count words for all posts by all authors
- Word count for all posts of all authors
- Filter/Sort Post Form On Taxonomy page
- Global $post value outside the loop
- Category and archive issue
- How to get total posts count for each date?
- Remove Archive Posts Page
- Display posts on a custom page from only a specific category?
- Comment count next to post title?
- Display post archive as a month table, show last three months