Problem: I would like to use custom fields to store images and urls. On the front-end of the site I would like to display those images as links, and use the url from the custom field as the link destination.
Solution: You could do this with a Repeatable Field Group (RFG) in the post, and a View of those RFGs.
- Create a RFG in some post field group that is assigned to this custom post type.
- In the field group editor, find the RFG and add a custom image field and a URL field. Save the field group.
- When editing a post in wp-admin, you will create a new RFG for each image/link pair. Upload an image and define the link URL for each RFG. We also support creating simple RFGs using Forms.
- To display the image/link pairs in the single post template, you will create a View of RFG. Apply a post relationship filter where the post parent is the current page. In the loop of this View, insert custom HTML to wrap a link tag around the image field shortcode.
Relevant Documentation:
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/
https://toolset.com/documentation/getting-started-with-toolset/creating-and-displaying-repeatable-field-groups/front-end-forms-for-repeatable-field-groups/
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 |
---|---|---|---|---|---|---|
8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | 8:00 – 12:00 | - | - |
13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | 13:00 – 17:00 | - | - |
Supporter timezone: America/New_York (GMT-04:00)
This topic contains 2 replies, has 2 voices.
Last updated by 5 years, 9 months ago.
Assisted by: Christian Cox.