Skip Navigation

[Resolved] Loop of pictures – One picture in each column

This thread is resolved. Here is a description of the problem and solution.

Problem:
Loop of pictures - One picture in each column

Solution:
You can use [wpv-for-each] shortcode to iterate through the repeating field entries.

You can find the proposed solution, in this case with the following reply:
https://toolset.com/forums/topic/loop-of-pictures-one-picture-in-each-column/#post-1219693

Relevant Documentation:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each

This support ticket is created 5 years 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 4 replies, has 2 voices.

Last updated by jean-francoisB 5 years ago.

Assisted by: Minesh.

Author
Posts
#1219240
pictures-view.png
pictures-stacked.png

HI,

I have created a view that shows pictures. For some reason, if we have more then 1 picture, the pictures are added in the same column instead of having one picture per column. If you look at the print screen attached, you can see that I ask to my loop to show one picture per column. But the result is not what I want. All pictures are in the first column.

Do you know what I need to do to show one picture in each column so if I have for example 3 pictures they will be horizontally aligned to cover the full width of the page instead of being stacked in the first column?

Thank you very much,

Jeff

#1219415

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

Well - I see the view you created is using Bootstrap classes.

Is Bootstrap is loaded from your plugin or theme? If no:
=> You can activate the Bootstrap should load by Toolset from:
- Toolset => Settings => General => Bootstrap loading => Select option "Toolset should load Bootstrap 3.0"

If that is already active, then I need to check what's going wrong on your setup.

#1219673

Hi,

Thanks for your reply. Yes, the option "Toolset should load Bootstrap 3.0" is already activated.

I have created an admin access to the website :

hidden link
user : toolset
Pass : Vvaf%X55i$taZATBLg*58Rw9

Thank you very much for your help!

Jeff

#1219693

Minesh
Supporter

Languages: English (English )

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

Well - can you please check now.

The reason why it was not working because the pictures field is repeating field so you do not need a view to display that but instead you should use the view's shortcode [wpv-for-each].

I've changed the code as given under within your template:

<div class="listing-pictures">
  <div class="row">
  [wpv-for-each field="wpcf-pictures"]
  <div class="col-sm-4">[types field="pictures"][/types]</div>
  [/wpv-for-each]
 </div>

=> hidden link

I can see how the images displayed as per your expectation:
=> hidden link

More info:
=> https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each

#1219694

Thank you for your help! I didn't know about the "for each" option. I learn a bit every day! Have a great weekend!

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