Tagged: advanced layout builder
Hi,
Is is possible through a function (or even a class) to see on a page if the advanced layout builder is enabled or not?
Thanks, Wz
Hi,
Thanks for contacting us!
When ALB is enabled, “avia-advanced-editor-enabled” class is added to Body tag. Would it work for you? :)
Best regards,
Yigit
Hi,
No I meant the front-end, not the back-end.
I can’t find any specific class present on the front-end when the ALB is activated.
Greetings
Hi,
Please add following code to bottom of Functions.php file in Appearance > Editor
add_filter( 'body_class', 'av_custom_class' );
function av_custom_class( $classes ) {
global $wp_query;
$builder_stat = Avia_Builder()->get_alb_builder_status( $wp_query->post->ID );
if( ( 'active' == $builder_stat ) && ! is_preview() ) {
$classes[] = 'alb-enabled';
}
return $classes;
}
This should add “alb-enabled” to Body tag of pages that were created with ALB :)
Best regards,
Yigit
Thank you very much!