Skip Navigation

[Resolved] showing index

This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by nelsonT-2 7 years, 2 months ago.

Assisted by: Minesh.

Author
Posts
#489778

Hi,

I'd like to use an index in the output of a view.

What I need is a button with a label that says "Video of week 1", "Video of week 2" and so on...

Though it's not documented, I found out the shortcode [wpv-index], but that doesn't work (just outputs the shortcode). I tried both directly in the loop and in a content template.

Here's my current code:
<div class=" ubtn-ctn-left btnWArrow"><a class="ubtn-link ult-adjust-bottom-margin ubtn-left ubtn-normal btnWArrow wplightbox" href="[types field='video' output='raw'][/types]" target=""><button type="button" id="ubtn-8984" class="ubtn ult-adjust-bottom-margin ult-responsive ubtn-normal ubtn-no-hover-bg none ubtn-sep-icon ubtn-sep-icon-at-right ubtn-left tooltip-58a4c64a75d04" data-hover="" data-border-color="" data-bg="#6caddf" data-hover-bg="" data-border-hover="" data-shadow-hover="" data-shadow-click="none" data-shadow="" data-shd-shadow="" data-ultimate-target="#ubtn-8984" data-responsive-json-new="{"font-size":"desktop:14px;","line-height":""}" style="font-family:'Open Sans';font-weight:700;border:none;background: #6caddf;color: #ffffff;"><span class="ubtn-data ubtn-icon"><i class="Defaults-long-arrow-right" style="font-size:25px;color:#ffffff;"></span><span class="ubtn-hover" style="background-color:"></span><span class="ubtn-data ubtn-text ">VIDEO SEMAINE [wpv-index]</span></button></a></div>

Is there another way to get the index, or is something wrong in my code?

#489832

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - to display loop output index you need to use the custom shortcode to display the index.

For example - add following code to your current thee's functions.php file:

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

And use the shortcode as:

VIDEO SEMAINE [incrementor]
#489989

Thanks a lot! Works like a charm!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.