Hi,
I would like to add the Layout Builder to a custom post type, using a child theme. I have checked out this video and the changes only work when applied to the main enfold theme, not the child theme.
I guess Dude’s response to another thread explains in a different context, however I have not spent too long looking at structures of the theme and therefore not sure on the code I should use.
Thx
Any suggestions?
Hello!
I’m not sure if this is easily possible because the template builder requires a special template (compare single-portfolio.php for the portfolio cpt) but you can use a filter to register the cpt for the advanced layout builder meta box. Add following code to the child theme functions.php and replace mycpt with your custom post type slug.
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'][] = 'mycpt';
}
}
return $boxes;
}
Best regards,
Peter