Home › Forums › ACF PRO › Custom Fields on Attachments › Reply To: Custom Fields on Attachments
I have added some custom fields to all attachments that are uploaded to the Media Library.
Text fields such as Location, Date, and some custom Tags.
I then have a custom post type of Photo Archive in which the admin can create a new post, upload as many images as they wish, which will then display on the single post page. The images are uploaded using the ACF Gallery field.
Each image will have a tag or tags, as well as Location and Date information attached to it.
What I now require is to get that information.
So far I have created this staging site: http://website-test-lab.com/sites/zuludawn/photographic-archive/
If you see where it says Filter by tags; this is where I need to get all the tags used from each image, from within the single post.
I did take a look at the code here but not sure where to put it or how to use it: http://www.advancedcustomfields.com/resources/how-to-get-values-from-a-media-attachment/
Any advice would be much appreciated.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Plugin boilerplates can do some of the heavy lifting during initial development. We look at four options to speed up your plugin creation. https://t.co/ZtMsdBxAHw
— Advanced Custom Fields (@wp_acf) June 5, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.