Support

Account

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' );