Home › Forums › ACF PRO › acf-json fields not loading from parent theme › Reply To: acf-json fields not loading from parent theme
I think it would be safer to use the filters for this. In my setup I want to use both the child theme and parent theme acf-json, but only save to the child theme acf-json folder:
add_filter('acf/settings/save_json', function() {
return get_stylesheet_directory() . '/acf-json';
});
add_filter('acf/settings/load_json', function($paths) {
$paths = array(get_template_directory() . '/acf-json');
if(is_child_theme())
{
$paths[] = get_stylesheet_directory() . '/acf-json';
}
return $paths;
});
Documented here.
I hope it 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.