I'm using a Genesis child theme and I've set up a filter to force the full width layout when the sidebar is empty.
add_filter( 'genesis_pre_get_option_site_layout', 'crc_remove_empty_sidebar' );
function crc_remove_empty_sidebar( $opt ) {
if ( ! is_active_sidebar( 'primary-sidebar' ) ) {
$opt = 'full-width-content';
return $opt;
}
}
And that's working great except for if the admin manually selects a layout option when creating the post. When a layout option is manually selected, it takes precedent on Single pages.
Is there any way to make the filter I have override everything else, so that no matter what layout option is manually selected the filter forces the full width layout anyway?
I've been searching and trying different things but surprisingly I haven't been able to find much of anything.