Title: Incremental numbers in loop
Last modified: August 30, 2016

---

# Incremental numbers in loop

 *  [pappo87](https://wordpress.org/support/users/pappo87/)
 * (@pappo87)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/incremental-numbers-in-loop/)
 * Hello,
    my loop will be something like this -set tabnumber to 0
 *     ```
       [loop field=city value='{VALUE}']
       [if first]<div class="tab-[field value=tabnumber+1]">[-loop field=city value='{VALUE}']<li>...</li><li>...</li><li>...</li>[/-loop]</div>[/if]
       [/loop]
       ```
   
 * I need to have an incremental number for each loop. I need this because results
   will go in a tabbed view and I need different number for each tab.
    Does your
   plugin already support incremental numbers? I could find only random number in
   reference. Thank you!
 * [https://wordpress.org/plugins/custom-content-shortcode/](https://wordpress.org/plugins/custom-content-shortcode/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/incremental-numbers-in-loop/#post-6358548)
 * Hello,
 * There’s a shortcode called `[loop-count]` which outputs the current index of 
   the loop. Could you try and see if that can be used?
 *  [lenningrl](https://wordpress.org/support/users/lenningrl/)
 * (@lenningrl)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/incremental-numbers-in-loop/#post-6358562)
 * Such a simple thing and so very handy for numbering the tabs from another plugin,
   but I never could find a shortcode to do this before. Thanks so much for this
   tip!
 *  Plugin Author [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * (@miyarakira)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/incremental-numbers-in-loop/#post-6358569)
 * I added a note about `[loop-count]` in the documentation.
 * There’s another shortcode that might be of interest, which I haven’t documented
   yet.
 *     ```
       [x 10]
         {X}
       [/x]
       ```
   
 * The `[x]` shortcode just loops for the number of times specified. Inside, `{X}`
   will display the current index. I usually use it for testing purpose, to create
   a hundred loops for example. 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Incremental numbers in loop’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Eliot Akira](https://wordpress.org/support/users/miyarakira/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/incremental-numbers-in-loop/#post-6358569)
 * Status: not resolved