Tagged: Custom Post Type, performance, whitespace
I have a custom post type (events) which I had to use this filter to get the Advanced Layout Builder to appear –
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';
}
}
return $metabox;
}
When I add a Whitespace widget on an event I get an error on the front end:
Admin notice for:
Separator / WhitespaceThis element was disabled in your theme settings. You can activate it here:
Performance Settings
In the performance settings, setting ‘Disabling of template builder elements’ to ‘Always load all elements’ fixes the problem. Obviously, I’d prefer not to have it set that way. Is there some other filter I can add to put my event post type into the Whitespace’s good graces? :)
Hey pippylu,
Sorry for the late reply, please try this solution
Best regards,
Mike
Thank you – this worked for me –
I went to Performance > “Disabling of template builder elements” and switched back to “Load only used elements (recommended)”
and then in the next section down I set
“Scan Widgets for Theme Shortcodes” = “Scan widgets”
and the page no longer errors.