Hi there!!!
I have a CPT where my client can upload images to show in a gallery. I have a repeating image field and a post form for them to upload said images. I am trying to limit the number of images shown in the gallery to 18 but I'm pretty sure I just realized that my view setting of "Display 18" is displaying 18 posts worth of images. So if there are more than 1 image (using the repeating field) per post then it's showing the 18 actual posts (worth of images) instead of 18 images in whole.
I'm using this for the loop:
[wpv-for-each field='wpcf-inmanimages']
[types field='inmanimages' width='150' height='150' align='none' resize='crop'][/types]
[/wpv-for-each]
and a blocks content template attached to the view being output into an Elementor page. Seems to work fine with the exception stated above.
I've spent a couple hours in here trying to find a solution.
Also: I am going to want to display all with pagination on a different gallery page, so please let me know if I need to keep that in mind with whatever solution we end up with.
As always, thanks so much!!!
Jason
Hello,
I assume we are talking about a post view:
- Query your custom posts
- In view's loop, you are displaying the repeating image field with the codes you mentioned above.
If it is, then it is expected result:
So if there are more than 1 image (using the repeating field) per post then it's showing the 18 actual posts (worth of images) instead of 18 images in whole.
The post view can only setup limitation on posts, it can not setup limitation on repeating image field.
You might consider other workaround, for example:
Display only one image for each post, replace the codes you mentioned above as below:
[wpv-for-each field='wpcf-inmanimages' start="1" end="1"]
<a href="[types field='inmanimages' size='full' url='true'][/types]">[types field='inmanimages' width='150' height='150' align='none' resize='crop'][/types]</a>
[/wpv-for-each]
More help:
https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#vf-153482
Thanks, Luo.
I think it would be easier to just change the repeating field to a single image. *Far less confusing for the client.
Thank you for trying to help!!
My issue is resolved now. Thank you!