Skip Navigation

[Résolu] Create a dynamic class attribute

This support ticket is created Il y a 7 années et 9 mois. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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)

Marqué : ,

This topic contains 1 réponse, has 2 voix.

Last updated by Minesh Il y a 7 années et 9 mois.

Assisted by: Minesh.

Auteur
Publications
#420618

Hi Guys,

quick question,

I have to following loop

...
 <div id="container">  
    <wpv-loop>
     	<div class="flex-item">[wpv-post-body view_template="Home page categories"]</div>
    </wpv-loop>
</div>
...

Is there a way of creating a dynamic class for the class=flex-item for every time it ran through the loop. Ie I would like to see a result of the following for every flexbox in the series:

class="flex-item item1"
class="flex-item item2"
class="flex-item item3"
ETC

for each of the resulting boxes in the series for the loop. The reason for this would be to to identify a specific box for css editing

Thx

#420660

Minesh
Supporter

Languages: Anglais (English )

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

Hello. Thank you for contacting the Toolset support.

Have you looked at [wpv-item] shortcode?

For example:

...
 <div id="container">  
    <wpv-loop>
[wpv-item index=1]
        <div class="flex-item item1">[wpv-post-body view_template="Home page categories"]</div>
[wpv-item index=2]
<div class="flex-item item1">[wpv-post-body view_template="Home page categories"]</div>
[wpv-item index=3]
<div class="flex-item item1">[wpv-post-body view_template="Home page categories"]</div>
    </wpv-loop>
</div>
...

More info:
https://toolset.com/documentation/views-shortcodes/#wpv-item

Does this helps/

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