Skip Navigation

[Resolved] Loop count to display custom html row and continue with loop

This support ticket is created 7 years, 10 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 1 reply, has 2 voices.

Last updated by Minesh 7 years, 10 months ago.

Assisted by: Minesh.

Author
Posts
#459140

I am trying to: Display Custom html inside a loop, let me explain. If i have 60 products in my query and have defined a <wpv-loop wrap="3" pad="true"> I would like to insert custom html when loop has count 6 items, 12 and 30
[Product] [Product] [Product]
[Product] [Product] [Product]
[Custom HTML ]
[Product] [Product] [Product]
[Product] [Product] [Product]
[Custom HTML ]
[Product] [Product] [Product]
[Product] [Product] [Product]
[Custom HTML ]

Without creating diferents views, is it possible to do this?

#459283

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

You may try to use [wpv-item] shortcode with "index" attribute:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-item

For example:

<wpv-loop>
    [wpv-item index=6]
      your output 
    [wpv-item index=12]
      your output
    [wpv-item index=other]
      your output
 </wpv-loop>

More info:
https://toolset.com/documentation/user-guides/digging-into-view-outputs/
[Section: "Loop parameters & wpv-item : wrap, pad, pad-last, index"]

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