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 🙂
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.