filters - Override admin selected page layout

I'm using a Genesis child theme and I've set up a filter to force the full width layout when the sidebar is em

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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745533291a4631792.html

相关推荐

  • filters - Override admin selected page layout

    I'm using a Genesis child theme and I've set up a filter to force the full width layout when the sidebar is em

    1天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信