Support

Account

Home Forums General Issues ACF wrapper attributes

Solving

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.

  • its not for the admin, … for the frontend instead ^^

  • 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>
    
Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

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.