Problem: The grid system I have set up in a View appears to be broken when an odd number of posts is shown.
Solution: Use index=pad-last to close any open rows at the end of the loop.
<!-- wpv-loop-start --> <wpv-loop wrap="2" pad="true"> [wpv-item index=1] <div class="row"><!-- Open Row --> [wpv-post-body view_template="WordPress Archive 1 - loop item 3"] [wpv-item index=2] [wpv-post-body view_template="WordPress Archive 1 - loop item 3"] </div><!-- Close Row ( Even ) --> [wpv-item index=pad-last] </div><!-- Close Row ( Odd ) --> </wpv-loop> <!-- wpv-loop-end -->
Relevant Documentation:
https://toolset.com/documentation/user-guides/digging-into-view-outputs/#loop-shortcode-wpv-item-and-the-index-parameter
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.
Our next available supporter will start replying to tickets in about 3.70 hours from now. Thank you for your understanding.
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 2 replies, has 2 voices.
Last updated by 6 years, 9 months ago.
Assisted by: Christian Cox.