[Resuelto] How to display media custom fields in single page
This support ticket is created hace 5 años, 5 meses. 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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
I've added custom fields to the media post type, but I'm having a couple of issues.
1) Is there a way of getting these fields to display when using 'add media' in the post editor?
2) I don't know how to get the field data to display on the front-end. I have a custom single template, and I'd like to get the field data to display underneath each image on the single post page.
2) I don't know how to get the field data to display on the front-end. I have a custom single template, and I'd like to get the field data to display underneath each image on the single post page.
- You can get and show the custom fields data for the media post type (same as with other post types), using "Types Fields API".
On the second point, I understand how to display the field data for specific items, but I'm not clear how to display it for media items that have been added via the WordPress content editor. For example, I have added a custom text field for 'attribution' that I would like to display under every image that's added via the editor. Can you tell me how to do that?
Since this question is related to WordPress' default functionality and not specifically Toolset plugins, I'll recommend posting this to WordPress development forums, for the most accurate and efficient suggestions/workarounds.