Home › Forums › General Issues › ACF wrapper attributes
hi everyone,
i put some class into wrapper attributes -> class in the ACF backend , but, when i inspect it with the chrome inspector source code custom class are not used or displayed.
anyone could help me
The class is added to the field wrapper div. Here you can see the HTML generated by ACF and where the class “my-test-class” is added
<div class="acf-field acf-field-text acf-field-5ec2e6904879a my-test-class" data-name="test_field" data-type="text" data-key="field_5ec2e6904879a">
<div class="acf-label">
<label for="acf-field_5ec2e6904879a">test field</label></div>
<div class="acf-input">
<div class="acf-input-wrap"><input type="text" id="acf-field_5ec2e6904879a" name="acf[field_5ec2e6904879a]"/></div></div>
</div>
so it’s not really convenient as it can seems at first look, but maybe i don’t understand the better interest.
Why are you adding the class and what is it you expected to do by adding it?
css customization for sure. what do you expect and what class are used for ?
These classes are used only in the admin or when a acf form is shown. If you want to make css changes to the admin then yes, they can be used. It’s just a matter of targeting what you want with your css selector.
ACF does not provide anything for the front end. If you want to put a wrapper around a field value then you need to code it in your theme templates.
<div class="my-class"><?php the_field('my-field'); ?></div>
The topic ‘ACF wrapper attributes’ is closed to new replies.
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.