First of all, please don’t use query_posts, but a new WP_Query.
Outpu count based on page is just a matter of a simple arithmetic operation using current page number and posts per page number.
global $wp_query;
$paged = $wp_query->get('paged') ? : 1;
$posts_per_page = 10; // feel free to change this
$args = array(
'cat' => 47,
'meta_key' => 'cb_vote_nb_vote',
'orderby' => 'meta_value',
'order' => 'DESC',
'paged' => $paged,
'posts_per_page' => $posts_per_page
);
$query = new WP_Query( $args );
if ( $query->have_posts() ) : while ( $query->have_posts() ) : $query->the_post();
$current_order = ( $query->current_post + 1 ) + ( $posts_per_page * ( $paged - 1) );
echo 'Current post order is :' . $current_order;
endwhile; endif;
wp_reset_postdata();
Related Posts:
- How to limit the number of posts that WP_Query gets?
- Random sort within an already sorted query
- how to get a different html for odd/even posts?
- How to know if get_posts() failed?
- How to display posts by current user/author in a custom page template?
- Using $wpdb to query posts with meta value containing current post_id
- Query posts from current year
- WordPress Number of Posts Not Changing With posts_per_page
- I have over 4000 posts, will querying some of them cause performance issues?
- Duplicate posts
- Looping through posts per category gives same posts for each category
- Show Custom Taxonomy Categories, Listing of Posts, and Single Post via AJAX
- How to add posts to wp_query result?
- Trying to put an array into ‘post__in’ => array() query not working
- Order post by year DESC and month ASC
- How can I display a specific user’s first published post?
- Query All users that has post
- Search query – exact post title match
- Sorting posts alphabetical that have single digits
- Display page content AFTER a loop of posts
- Get posts by multiple ID’s (query)
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Only display a certain number of posts, dependent on how many posts there are available in a query
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Query how many items to show in shortcode
- Get posts by name and taxonomy term
- Get Posts that are in the current month or later
- Sticky post appears twice
- How Can I Query a Specific Page From a MultiPage paginated Post
- Get Meta Key Value While Saving Post
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- Exclude the first ‘n’ number of posts of a tag from home page?
- How i can limit period of post publication?
- How to setup a query to output posts by groups of five?
- Exclude current custom post on single post
- First x post with another template then the others
- Why Query is returning empty array?
- Delete all drafts?
- Wrap every month posts in div
- meta_value timestamp older than now
- post__in not working with pre_get_posts, but post__not_in does work
- Can’t get full post title if there a spaces in title
- Query for first 3 posts to change the look and feel
- Why posts array is empty?
- Query posts and filter at query time by value of custom meta
- Very complex post query
- Delete post revisions only for a single post
- Display post by click on the link
- Queries take 120+ seconds on my large WordPress site
- Related Posts function not working
- WordPress loop not working on static front page
- How to display only one category in a custom post type?
- Export all posts to import as product items
- Custom Select Query – Selecting the Year?
- Anyone know a php snippet for showing the first 200 characters of the most recent post?
- Get current taxonomy and display query accordingly
- Prevent duplicate pages from being added
- Show 10 latest posts only from users with contributors role
- WordPress, custom post type and posts query help!
- How Can I Always Display A Particular Post First Using WP_Query?
- Return records between two meta datetimes saved as strings
- WordPress Query – Display 5 posts (same post type), each from a given tag
- Check if almost 10 year old – working code is up to date
- Query to fetch custom taxonomy along with post title
- How to fetch courses in all languages in WordPress?
- Query custom post type custom meta key
- Ignore posts content in the posts queries for internal linking
- filter posts based on menu_order
- Count posts for pagination
- Show 5 posts and than 3 posts offset with pagination
- I need some explanation on global $post [duplicate]
- How to delete all posts with dead image urls?
- Querying posts from current category, using a variable as array argument
- Query posts from newest category
- Sort Events by Venue Title – Sort Post set by related post ids
- wp query custom orderby not custom field
- Query post by meta key of another table
- Query post category & remove any post id
- Ordering posts alphabetically by meta keys and title
- Why I obtain this WP_Query strange behavior trying to select posts having a specific tag?
- Why I have this strange behavior when I try to exlude the featured post from posts visualization?
- Grab next post title in archive page
- Removing a post from the results of a WP Query
- Query posts from a specific category and selected tag
- Sort post by category using HTML Select tag
- WP_Query retrieve custom posts but not the post showing
- Special Query: Title, Terms, Content – %LIKE%
- Creating pages and getting their values from the database table
- How to limit post query to only return a total count of items with certain post statuses?
- How to set value in Query Loop?
- Wp_query WooCommerce products
- The page that displays Posts on homepage
- query_post or single-[cpt].php?
- Display posts with id equal to relationship value
- Sort Posts Alphabetically Based on Specific Category (Divi)
- Change permalinks in posts via SQL
- How can I change the post order after filtering in WordPress?
- How to make WP_Query faster when getting a post from one year ago?