Tagged: Advance layout editor, pages, posts
Hi,
I’m using the following to enable the advanced editor on “event” but I also need to have it enabled for “event-recurring” but I’m really struggling with what should be a simple bit of php code.
/ Enable Enfold Advance Layout Editor on Event pages
add_filter('avf_builder_boxes', 'add_builder_to_posttype');
function add_builder_to_posttype($metabox)
{
foreach($metabox as &$meta)
{
if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
{
$meta['page'][] = 'event'; /*instead add the name of the custom post type here*/
}
}
return $metabox;
}
Hey DigitalEssence,
You can copy this part of the code:
$meta['page'][] = 'event';
paste it just the bottom of it then replace event with event-recurring, it should look like this:
add_filter('avf_builder_boxes', 'add_builder_to_posttype');
function add_builder_to_posttype($metabox)
{
foreach($metabox as &$meta)
{
if($meta['id'] == 'avia_builder' || $meta['id'] == 'layout')
{
$meta['page'][] = 'event'; /*instead add the name of the custom post type here*/
$meta['page'][] = 'event-recurring';
}
}
return $metabox;
}
Let us know if it works.
Best regards,
Nikko
Perfect,
that’s both types of pages using the Advanced Editor.
thank you. If I’d known it was that simple…
Hey!
You’re very much welcome. Thanks for using Enfold :)
Regards,
Nikko