Support

Account

Home Forums ACF PRO Include ACF in a theme

Solved

Include ACF in a theme

  • Hey guys,

    I have tried this a couple of times now, but i just can’t seem to figure it out.

    I followed http://www.advancedcustomfields.com/resources/including-acf-in-a-plugin-theme/

    I dowloaded a copy of the plugin.
    Uploaded it in my theme.
    renamed the folder to acf.

    created a file ACF_fields.php for all the fields i have created.
    and in functions.php i copied the code to call ACF.

    
    // 1. customize ACF path
    add_filter('acf/settings/path', 'my_acf_settings_path');
     
    function my_acf_settings_path( $path ) {
     
        // update path
        $path = get_stylesheet_directory() . '/acf/';
        
        // return
        return $path;
        
    }
     
    
    // 2. customize ACF dir
    add_filter('acf/settings/dir', 'my_acf_settings_dir');
     
    function my_acf_settings_dir( $dir ) {
     
        // update path
        $dir = get_stylesheet_directory_uri() . '/acf/';
        
        // return
        return $dir;
        
    }
     
    
    // 3. Hide ACF field group menu item
    add_filter('acf/settings/show_admin', '__return_false');
    
    // 4. Include ACF
    include_once( get_stylesheet_directory() . '/acf/acf.php' );
    
    

    but which path i am using, i just don’t work.
    What am i doing wrong? or what am i not doing?

  • Well got the plugin working now, but now the theme options page is not showing up…

    
    acf_add_options_page( array(
    

    Never mind, Fixed it…

    call the add_filters BEFORE the afc_add_options_page

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Include ACF in a theme’ is closed to new replies.