Is this not possible?
Someone able to assist me with this question? I have this on the back-burner but will need to address it early next week, or-else determine an alternative means of accomplishing this effect.
Thanks Elliot.
The UI of the new forum is great.
That sounds like it. How might I pull from the array the key?
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)?
I want this a dynamic class, though – that changes depending on the field(s) used
For example, if I have a basic text field, “field_test”, displayed via:
<?php the_field('field_test'); ?>
Displays the content entered via WP admin for that field.
How can I also display, separately, a unique identifier/class from that field on the front-end?
<?php the_field('field_test','id'); ?>
Displays the field ID for that field regardless of content entered.
or something to that effect?
These are not classes assigned in HTML markup that can be visually modified via CSS though, right? That is what I am wanting to achieve.
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!
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.