yanknudtskov
5/10/2017 - 1:37 PM

Adding support for Advanced Layout Builder on custom post types in Enfold Remeber to add the custom-post type to the arrays

Adding support for Advanced Layout Builder on custom post types in Enfold

Remeber to add the custom-post type to the arrays

<?php
	
	/**
	 * Enable Layout Builder for Custom Post Types
	 */
	add_theme_support('add_avia_builder_post_type_option');
	add_theme_support('avia_template_builder_custom_post_type_grid');

	add_filter('avf_builder_boxes','yanco_enable_cpt_layout_builder');
	function yanco_enable_cpt_layout_builder( $boxes ) {
		$boxex = array();

		$boxes[] = array( 'title' =>__('Avia Layout Builder','avia_framework' ), 'id'=>'avia_builder', 'page'=>array('post','portfolio','page','product', 'enfold_repeatable', 'CUSTOM_POST_TYPE_HERE'), 'context'=>'normal', 'priority'=>'high', 'expandable'=>true );
	    $boxes[] = array( 'title' =>__( 'Layout','avia_framework' ), 'id'=>'layout', 'page'=>array('post','portfolio','page','product', 'enfold_repeatable', 'CUSTOM_POST_TYPE_HERE' ), 'context'=>'side', 'priority'=>'low');
	    $boxes[] = array( 'title' =>__('Additional Portfolio Settings','avia_framework' ), 'id'=>'preview', 'page'=>array('portfolio'), 'context'=>'normal', 'priority'=>'high' );
	    $boxes[] = array( 'title' =>__('Breadcrumb Hierarchy','avia_framework' ), 'id'=>'hierarchy', 'page'=>array('portfolio'), 'context'=>'side', 'priority'=>'low');

		return $boxes;
	}