Support

Account

Home Forums ACF PRO Including ACF Pro in theme not including add-ons

Solving

Including ACF Pro in theme not including add-ons

  • I have used the code supplied to include the plugin in the theme as it is dependent on the plugin to operate.

    The custom fields menu is in the admin menu but the included add-ons are not running. I have lost my options menu.

    I added the ACF pro plugin and updated to latest version then copied the files into folder under theme root. Used the following code.

    // Run this code on 'after_theme_setup', when plugins have already been loaded.
    add_action( 'after_setup_theme', 'load_required_plugins' );
    // This function loads the plugin.
    function load_required_plugins() {
    
    	// Checking and loading ACF Pro
    	if ( ! class_exists( 'acf' ) ) {
    
    		// 1. customize ACF path
    		add_filter( 'acf/settings/path', 'rrm_acf_settings_path' );
    		function rrm_acf_settings_path( $path ) {
    
    			// update path
    			$path = get_stylesheet_directory() . '/acf-plugin/';
    
    			// return
    			return $path;
    		}
    
    		// 2. customize ACF dir
    		add_filter( 'acf/settings/dir', 'rrm_acf_settings_dir' );
    		function rrm_acf_settings_dir( $dir ) {
    
    			// update path
    			$dir = get_stylesheet_directory_uri() . '/acf-plugin/';
    
    			// 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-plugin/acf.php' );
    	}
  • Hi @MrWilde

    What do you mean by but the included add-ons are not running?

    Thanks
    E

  • When I disable the ACF PRo plugin the ACF Options I have configured stop working and the menu disappears. So I assumed its not running the options plugin

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

The topic ‘Including ACF Pro in theme not including add-ons’ is closed to new replies.