Support

Account

Home Forums General Issues Add class to acf fields Reply To: Add class to acf fields

  • i am not sure if frontend form also add the Wrapper-Attribute class, but at normal backend the Wrapper-Attribute class or the ID are added to the container of the ACF Field (at least when you use ACF-Pro)

    look here at the screenshot image
    Wrapper Attribute are the last 3 input fields (all at same row) at each ACF-Field, above close Field. (class is the middle field)

    with help of Wrapper Attribute (class and ID) you should be able to style the backend.
    that means: add, for example “something” to the Wrapper Attribute class, and use that to style the backend (hope/think it works your frontendform too). and use code like from my first post to add class also to normal frontend view.

    maybe you need a bit nested css, because the class is added to the parent container of the field, and not the field itself where you add it.

    i am not sure, but i think you cant access these classes at normal frontend view, and you need to add these classes for normal frontend view manually.

    or you could use the fieldkeys of your ACF Fields directly as your css IDs
    and use that to style the backend.
    for example: #acf-field_508a263b40457
    (of course you need to replace field_508a263b40457 with the id of your field)

    hope that my explains are clear enough, and that they help to solve your problem.

    if you still have problems, post of the relvevant parts that you use codesnippets (and add maybe images, to show what is and what should be)