Get Iteration Count in Wordpress Loop


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # Standard Wordpress loop:
  2. $count = $wp_query->current_post + 1;
  3.  
  4. # Custom loop using WP_Query:
  5. $count = $custom_query->current_post + 1;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.