Home › Forums › Front-end Issues › How to display the ID of a custom field? › Reply To: How to display the ID of a custom field?
Nothing too unusual really. I don’t have the code on-hand, but take a repeater field setup, for example, where you loop through the different sub-fields…
I would like a particular piece of my markup, contained in the loop, to have a unique class name for each instance of, say, a particular sub-field. Rather than use a $count where you just assign a number to a class (ie: class-1, class-2…) for this sub-field, I’m wondering if there is a way to pull a unique identifier for that sub-field to use as a classname in the markup (ie: fieldname-12)?
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.
— Advanced Custom Fields (@wp_acf) February 23, 2023
👉 https://t.co/3UtvQbDwNmhttps://t.co/wfFEVcXVKc
© 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.