Add Classes to Bricks' Body Class Using Dynamic Data

Would be very powerful if we could add classes to the <body> using dynamic data. This would allow us to add classes to the body on a per-page or per-post basis from custom fields and then manipulate the page styling based on these body classes.

I know this is possible with custom code, but having it built into Bricks would be a huge benefit.

74 Likes

C’mon amigo, keep ya hands dirty :slight_smile:

i did that with some custom code:

function add_acf_body_class($class) {
    $value = get_field('color');
    $class[] = $value;
    return $class;
}
add_filter('body_class', 'add_acf_body_class');
6 Likes

we need it up +1

check it Add Dynamic Body CSS Class Control - Bricks Builder Page Settings Customization - Pure Coding Knowledge Sharing Blog

1 Like