Support

Account

Home Forums Backend Issues (wp-admin) ACF admin CSS/JS not loading Reply To: ACF admin CSS/JS not loading

  • Hey @justintoon, I had the exact same problem, and this is what fixed it for me:

    Starting on line 483 of acf.php, with //register acf scripts as the comment, you’ll see a series of arrays, look for the lines that start with $this->settings['dir'], for example:

    'src' => $this->settings['dir'] . 'js/field-group.min.js',

    And change each of those references to include the bloginfo url, like this:

    'src' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/js/field-group.min.js',

    Do this replacement for lines 483-499, and also on lines 525-532, so that it’s loading your actual path to the files, instead of getting confused with the local path.

    So here’s the end results for those two chunks of code:

    lines 483-499:

    // register acf scripts
    $scripts = array();
    $scripts[] = array(
    'handle' => 'acf-field-group',
    'src' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/js/field-group.min.js',
    'deps' => array('jquery')
    );
    $scripts[] = array(
    'handle' => 'acf-input',
    'src' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/js/input.min.js',
    'deps' => array('jquery')
    );
    $scripts[] = array(
    'handle' => 'acf-datepicker',
    'src' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/core/fields/date_picker/jquery.ui.datepicker.js',
    'deps' => array('jquery', 'acf-input')
    );

    lines 525-532:

    // register acf styles
    $styles = array(
    'acf' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/css/acf.css',
    'acf-field-group' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/css/field-group.css',
    'acf-global' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/css/global.css',
    'acf-input' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/css/input.css',
    'acf-datepicker' => get_bloginfo('url') . '/wp-content/plugins/advanced-custom-fields/core/fields/date_picker/style.date_picker.css',
    );

    Hope that helps 🙂