JiveDig
7/28/2017 - 4:43 PM

Mai Pro - Force primary and secondary sidebars to the same width

Mai Pro - Force primary and secondary sidebars to the same width

<?php
// Add near the bottom of functions.php, without the above <?php

// Force secondary sidebar to 1/4th width on Sidebar Content Sidebar layout.
add_filter( 'genesis_attr_sidebar-primary', function( $attributes ) {
	$layout = genesis_site_layout();
	if ( 'sidebar-content-sidebar' !== $layout ) {
		return $attributes;
	}
	$attributes['class'] = str_replace( 'col-lg-4', 'col-lg-3', $attributes['class'] );
	return $attributes;
}, 99 );

// Force secondary sidebar to 1/4th width on Sidebar Content Sidebar layout.
add_filter( 'genesis_attr_sidebar-secondary', function( $attributes ) {
	$layout = genesis_site_layout();
	if ( 'sidebar-content-sidebar' !== $layout ) {
		return $attributes;
	}
	$attributes['class'] = str_replace( 'col-lg-2', 'col-lg-3', $attributes['class'] );
	return $attributes;
}, 99 );