[Resolved] CAn’t get repeating field to output in a loop
This thread is resolved. Here is a description of the problem and solution.
Problem:
CAn't get repeating field to output in a loop
Solution:
Actually, we found that actually if you check the page source code, images are rendered but it's not displaying but you added the attribute to div style="display:none
I'm trying to build some basic HTML using all the images in a repeating image field. I've constructed my loop and content template as per the attached image. The page renders without any of the HTML.
If I remove the [wpv-for-each field="main-images"] shortcode, the HTML renders, but there's only a single image.
That is strange. Can you please share problem URL where you want to display the repeating field as well as access details.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
I checked on your install and I found that actually if you check the page source code, images are rendered but its not displaying but you added the attribute to div style="display:none;" that is why its not displaying.
Further, I checked that there is the following javascript error on your browser's console:
glacier-bear-lodge:5812 Uncaught TypeError: $(...).unitegallery is not a function
at HTMLDocument.<anonymous> (glacier-bear-lodge:5812)
at i (jquery.js:2)
It look like its not able to reach the unitegallery script or its not loaded.
I'm terribly embarrassed...I knew about the setting the main div to "display: none" (intentional) and the fact that the library wasn't being loaded...but I thought for sure I checked that the HTML structure for the image gallery was not being output. It was there all along though. How careless of me.
Everything's good. But can I ask you what is the purpose of the "wpcf-" prefix on the for-each loop? Why is it needed?
When you create a custom field using Types plugin each custom field slug will have prefix as "wpcf-" but when you use Types shortcode to display the custom field, you do not have to add that: