Skip Navigation

[Resolved] Showing Repeatable Image Fields as Single Images in a Gallery from Child Posts

This support ticket is created 3 years, 2 months 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by aaronW-4 3 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#2384135

Tell us what you are trying to do?
I have a parent post type called "campus" and a child post type called "rooms". I have a repeatable image field in the child posts where I show a gallery for a that specific room. I would like to have a master gallery where I show all of the images from all of the rooms (child posts) on the main campus page (parent post).
Is it possible to create this master gallery from repeatable image fields from the child posts?

#2384157

Or something that would work even better for me... Is there a way to have a repeatable image upload field in a cred form, and a new child post is created for each uploaded image with each of the images being the featured image for each post?

#2384397

Hello,

For the question:
Is there a way to have a repeatable image upload field in a cred form, and a new child post is created for each uploaded image with each of the images being the featured image for each post?

There isn't such kind of built-in feature within Toolset plugins, you might consider custom codes, for example:
1) After user fill and submit the post forms, use action hook cred_save_data to trigger a custom PHP function:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

2) In this PHP function, get the repeating image field values:
https://developer.wordpress.org/reference/functions/get_post_meta/
use those values to create different room posts:
https://developer.wordpress.org/reference/functions/wp_insert_post/
Setup post relationships between "campus" and "Room"
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_connect_posts
And setup the room posts feature image:
https://developer.wordpress.org/reference/functions/set_post_thumbnail/

#2384683

It's good to know it might be possible.
I am not proficient with this type of coding, but I will see what I can do. Thank you for your guidance.

#2385129

If you need more assistance for it, please provide a test site with the same problem, I can setup a demo in it

#2385997

Since you are using Gravity Forms to create the "Contributions" post, it is out the range of Toolset supports, we don't provide support for other plugins, you might contact Gravity Forms for it

If you need Toolset supports, please point out the problem and page URLs and Toolset post form URL.

#2387659

Makes sense. Appreciate it.