admin管理员组文章数量:1023092
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.
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.
本文标签: filtersOverride admin selected page layout
版权声明:本文标题:filters - Override admin selected page layout 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745533289a2154847.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论