Hi folks,
I´m working on a custom theme, which uses a lot of custom fields. I´m using the latest version of Toolset Types (free version) and want to create a repeatable field.
This is the HTML code, which schould be written into the site.
<figure id="" class="">
hidden link">
<img alt="example4" src="hidden link">
<figcaption>The caption of the image</figcaption>
</figure>
Though it should be used to create an image gallery, this entire code has to be repeatable.
Custom fields would define:
- the URL in the <a> tag´s href
- the scr of the <img>
- the caption text in <figcaption>
I know how what inputs I have to use for the single fields, but I don´t know how I can set it up to be repeatable and what I have to write into the template file to output the above code in a repeatable way.
I hope I could make clear, what I´m wanting to do and hope you can help me with this.
Thanks in advance.
Dear Jens,
If you have a copy of Views plugin, you can setup it with shortcode [wpv-for-each]:
https://toolset.com/documentation/user-guides/views-shortcodes/#wpv-for-each
If you don't have Views plugin, you will need to create a custom shortcode for it, for example:
https://toolset.com/forums/topic/image-field-type-featured-image-how-can-i-display-image-title-alt-desc/#post-100666
Hi,
thank you for your help.
I found this article in the documentation, with which I could assign the fields as repeating field group to my custom post type:
https://toolset.com/documentation/user-guides/creating-groups-of-repeating-fields-using-fields-tables/
But I don´t know, how I can output the data in my template file with PHP.
Is there any clear documentation about this for not advanced PHP users?
You can follow our document to setup your custom PHP codes:
https://toolset.com/documentation/customizing-sites-using-php/displaying-child-posts/
section "Displaying child post contents"
Fantastic.
This works like a charm.
Thank you very much for your help.