Problem: I would like to create a carousel-style slider View that includes 3 posts per page. I would like to add a specific class to the middle item to make it appear larger than the other 2 items on the page.
Solution: Create a View with pagination, that shows 3 posts per page. You'll be able to use the Loop attributes item, index, wrap, pad, and pad-last to apply different styles to each of the 3 posts in a single page. Something like this, where the class is "middle-element":
[wpv-layout-start] [wpv-items-found] <wpv-loop wrap="3" pad="true"> [wpv-item index=2] <div class="middle-element">Post content here</div> [wpv-item index=other] <div>Post content here</div> [wpv-item index=pad] <div class="middle-element">Post content here</div> [wpv-item index=pad-last] <div></div> </wpv-loop> [/wpv-items-found] [wpv-no-items-found][wpml-string context="wpv-views"]<strong>Nothing to display</strong>[/wpml-string][/wpv-no-items-found] [wpv-layout-end]
Relevant Documentation:
https://toolset.com/documentation/user-guides/digging-into-view-outputs/#vmeta-wpv-loop-parameters
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 5 replies, has 2 voices.
Last updated by 6 years, 6 months ago.
Assisted by: Christian Cox.