-
AuthorPosts
-
February 14, 2015 at 5:55 am #396102
Hi Guys -I’m running a child theme on Enfold and I’d like to add the layout builder to my custom post types. I’ve had a look at this video
https://vimeo.com/64996057 and I’ve followed this post https://kriesi.at/support/topic/add-builder-to-other-custom-post-types/ and it works when i update the Parent theme’s meta.php file.howvver I want to make sure all the changes stay in the child theme – is there a way to do this?
I’ve already tried copying the folder and file directory into my child theme directory but it doesn’t register the builder.
Would love you help – thanks!
February 16, 2015 at 3:33 am #396508Hi ShortieD!
please refer to this: https://kriesi.at/support/topic/meta-php-in-child-them-not-working/#post-376445
Best regards,
AndyFebruary 23, 2015 at 8:48 am #400437Hi Andy – I followed the instructions from this post and added the below code to my functions.php for my child theme – this didn’t work – I still can’t get the ‘advanced layout editor’ to appear as suggested. Any clues? Thanks
/**ADDS THE LAYOUT EDITOR TO CPT’s*/
add_filter( ‘avf_builder_boxes’, ‘enfold_customization_posts_builder’ );
function enfold_customization_posts_builder( $b ){
$b[1][‘page’] = array( ‘portfolio’, ‘page’, ‘post’, ‘people’, ‘places’, ‘stories’ );
return $b;
}February 23, 2015 at 7:22 pm #400937Hi!
Try this out, https://kriesi.at/support/topic/overriding-functions-in-a-child-theme/#post-167093.
If you want to add them to more than one CPT then keep adding new lines like so.
$boxes[$key]['page'][] = 'people'; $boxes[$key]['page'][] = 'places'; $boxes[$key]['page'][] = 'stores';
Best regards,
ElliottFebruary 26, 2015 at 5:13 am #402443success! I added this to my functions and it worked – thanks.
/**ADDS THE LAYOUT EDITOR TO CPT’s*/
add_filter(‘avf_builder_boxes’, ‘avia_register_meta_boxes’, 10, 1); //Add meta boxes to custom post types
function avia_register_meta_boxes($boxes)
{
if(!empty($boxes))
{
foreach($boxes as $key => $box)
{
$boxes[$key][‘page’][] = ‘people’;
$boxes[$key][‘page’][] = ‘places’;
$boxes[$key][‘page’][] = ‘events’;
$boxes[$key][‘page’][] = ‘stories’;
}
}
return $boxes;
} -
AuthorPosts
- The topic ‘adding the avia layout builder to Custom post types’ is closed to new replies.