krista-m
3/18/2018 - 2:02 PM

Beaver Builder Full-Width

Allow for pages created with Beaver Builder to be full-width

<?php
// Template Name: Beaver Builder

add_filter( 'body_class', 'add_bb_body_class' );


/**
 * Adds a css class to the body element
 *
 * @param  array $classes the current body classes
 * @return array $classes modified classes
 */
function add_bb_body_class( $classes ) {

	$classes[] = 'fl-builder-full';
	return $classes;

}


/**
 * Add attributes for site-inner element, since we're removing 'content'.
 *
 * @param array $attributes Existing attributes.
 * @return array Amended attributes.
 */
function site_inner_attr( $attributes ) {

	// Add the attributes from .entry, since this replaces the main entry
	$attributes = wp_parse_args( $attributes, genesis_attributes_entry( array() ) );
	return $attributes;

}
add_filter( 'genesis_attr_site-inner', 'site_inner_attr' );


// Display Header
get_header();

// Display Content
the_post(); // sets the 'in the loop' property to true.

the_content();

// Display Comments
genesis_get_comments_template();

// Display Footer
get_footer();
.fl-builder-full .site-inner {
	max-width: none;
	padding-top: 0;
	padding-left: 0;
	padding-right: 0;
}

.fl-row-fixed-width {
	max-width: 900px !important;
}