Support

Account

Home Forums Front-end Issues Replacing frontend form html Reply To: Replacing frontend form html

  • There isn’t any way to replace the HTML structure of acf_form(). All of the JavaScript associated is dependent on what ACF creates. There is also not a way to add classes to individual parts of the field, only to the field wrapper div in PHP.

    There are some choices

    1) Add custom CSS that mimics the CSS used in your framework that targets the parts

    
    /* label */
    .acf-field .acf-label label {
      /* css for label here */
    }
    /* input or change for other types of fields */
    .acf-field .acf-input .input {
      /* css for input here */
    }
    

    2) Add custom JavaScript that adds classes to elements https://www.advancedcustomfields.com/resources/javascript-api/