Home › Forums › Backend Issues (wp-admin) › How to run ACF plugin once mytheme already ACF pro plugin › Reply To: How to run ACF plugin once mytheme already ACF pro plugin
Solved by myself.
just find the correct directories and put on child.
/*ACF*/
// 1. customize ACF path
add_filter('acf/settings/path', 'my_acf_pro_settings_path');
function my_acf_pro_settings_path( $path ) {
$path = get_template_directory() . '/includes/acf-pro/';
return $path;
}
// 2. customize ACF dir
add_filter('acf/settings/dir', 'my_acf_pro_settings_dir');
function my_acf_pro_settings_dir( $dir ) {
$dir = get_template_directory_uri() . '/includes/acf-pro/';
return $dir;
}
// 3. Hide ACF field group menu item
if ( ! has_filter( 'acf/settings/show_admin' ) ) {
add_filter('acf/settings/show_admin', '__return_true');
}
// 4. Include ACF
include_once( get_template_directory() . '/includes/acf-pro/acf.php' );
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.