I am trying to:
use toolset example of adding a counter to views.
Regarding this problem toolset actually refer to an example of toolset own adding custom code snippets/hacks.
https://toolset.com/documentation/adding-custom-code/count-the-number-of-views-loop-iterations/
and
https://toolset.com/forums/topic/specifying-which-view-an-incrementor-shortcode-looks-at/
But the example is not working for me!!
Please tell me how to get this function to work when apparently the
variable not are set and where is this global var pointing to?
So this example allways turns 0 because of
if ( !isset( $loop_n ) ) {
$loop_n = 0;
return $loop_n;
}
Looking forward to see a working example or how i can correct it!
Link to a page where the issue can be seen:
https://toolset.com/documentation/adding-custom-code/count-the-number-of-views-loop-iterations/
I expected to see:
an iteration number
Instead, I got:
allways get an 0
It depends on the view and the <wpv-loop> inserted into that.
My issue is resolved now. Thank you!