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
- 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?
- 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
- 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 posts from #6 to #20 on archive page
- 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?
- Display Published Posts Count for Certain Time Period
- How to display data in archive page?
- Archiving by academic year instead of calendar year
- 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]
- 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?
- I want to show my post for limited time, how is it possible?
- Echo the number of posts being displayed
- Exclude a category of posts in author template
- How to edit the ‘
- Post-Archive like a page in a specific subdirectory
- Display amount of pending posts in back/front end
- Display in category ( taxonomy) a number of post that I want
- Count user posts and store the number for later use
- Find out in which kind of archive am I
- why the posts queried from sql is more than those showed on the page?
- Archieve page, Advertisement Every 3 Posts
- Highlighting Current Category in the Archive and Feeds page
- Count the total views of all user posts published
- Permalink Short code showing unnecessary link text inside the loop
- Author post count in category
- How to hide protected posts from archive?
- blog post not accesible on click [closed]
- Redirect to custom post if custom archive page has just one result?
- Posts are not displaying on their category and tag page
- Show post count in custom taxonomy page
- Count singular post views automatically
- How to count posts in tags within time limit
- Counting Posts by Category
- show image gallery in archives or category page
- Prevent Archive URLs
- view a list of 3 future post, from the nearest to the most far
- Display number of post published every day
- Retrieve posts inside foundation tabs and tab-content split by 3 per row
- How do I apply a wordpress function to something with no ID inside an archive page?
- count_posts to a standalone link
- 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
- 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 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
- 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
- Filter/Sort Post Form On Taxonomy page