Home › Forums › General Issues › Add class to acf fields › Reply To: Add class to acf fields
do you talk about backend, or about frontend?
at backend there is the wrapper attribute with class/id, use that to do whatever you need
at frontend you could do whatever you wish:
$your_field = get_field('your_field');
echo '<div class="something">'; //whatever you like to wrap around(pre) your field
echo $your_field; //your field value
echo '</div>'; //whatever you like to wrap around(after) your field
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.