Skip to content

Instantly share code, notes, and snippets.

@yanknudtskov
Last active May 17, 2022 12:26
Show Gist options
  • Save yanknudtskov/b304f3d833ac999960fbab532ca915d1 to your computer and use it in GitHub Desktop.
Save yanknudtskov/b304f3d833ac999960fbab532ca915d1 to your computer and use it in GitHub Desktop.
Adding support for Advanced Layout Builder on custom post types in Enfold Remeber to add the custom-post type to the arrays #enfold #alb #custom-post-types #cpt
<?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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment