Skip Navigation

[Resolved] Incremental row numbers in Views

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.


This topic contains 6 replies, has 5 voices.

Last updated by masino.sinaga 8 years, 9 months ago.

Assigned support staff: Caridad.


Dear support!

I'm wondering if it is possible to insert incremental row numbers to the table generated by the View, so that line numbers be 1, 2, 3 ... Something that would work like an auto-increment field?

Thank you in advance


Dear Kirill,

Add these lines to functions.php in your theme folder:

add_shortcode('incrementor', 'incrementor');
function incrementor() {
static $i = 1;
return $i ++;

Then define your View template as:

<li class="container[incrementor]"> <li>

Please let me know if there is anything else that I can assist you with.



Thank you Caridad!
Never have thought I can do it this way, than you for the suggestion.


I am trying this out but its not working


[wpv-if i="[incrementor]l" evaluate="$i == 1"]
Design Template 1

[wpv-if i="[incrementor]l" evaluate="$i > 1"]
Design Template 2


How do i do this correctly? I have already included the shortcode function in my function


Hi Roville,

I try to make exactly the same thing of you.... without success for now.

Do you find a solution or maybe ideas to test with you ?

Thanks in advance,


Hi again, it's ok for me now.

Adriano give me another solution here

So I see that with a shorcode with attribute (we take each field with attribute) it's could be possible to make that you want Roville. It's complex but seems possible !



Thank you, Caridad! I've just found out this solution from your answer above.