From 11a9f047cc3165e15abc08e3bc0ed4b11207fce8 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Wed, 25 Sep 2013 16:35:26 +0000 Subject: [PATCH] Twenty Fourteen: make the content sidebar optional and alter the layout to full-width if the sidebar is not active, but without adding wider featured image (for now). Props iamtakashi, closes #25031. git-svn-id: https://develop.svn.wordpress.org/trunk@25624 602fd350-edb4-49c9-b593-d223f7449a82 --- .../themes/twentyfourteen/functions.php | 5 +++- .../themes/twentyfourteen/sidebar-content.php | 24 +++---------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/wp-content/themes/twentyfourteen/functions.php b/src/wp-content/themes/twentyfourteen/functions.php index b64ba1634a..28ef45cb19 100644 --- a/src/wp-content/themes/twentyfourteen/functions.php +++ b/src/wp-content/themes/twentyfourteen/functions.php @@ -470,7 +470,10 @@ function twentyfourteen_body_classes( $classes ) { if ( is_archive() || is_search() || is_home() ) $classes[] = 'list-view'; - if ( is_page_template( 'full-width-page.php' ) || is_page_template( 'contributor-page.php' ) || is_attachment() ) + if ( ( ! is_front_page() && ! is_active_sidebar( 'sidebar-3' ) ) + || is_page_template( 'full-width-page.php' ) + || is_page_template( 'contributor-page.php' ) + || is_attachment() ) $classes[] = 'full-width'; return $classes; diff --git a/src/wp-content/themes/twentyfourteen/sidebar-content.php b/src/wp-content/themes/twentyfourteen/sidebar-content.php index 2b3cd01296..347e15786a 100644 --- a/src/wp-content/themes/twentyfourteen/sidebar-content.php +++ b/src/wp-content/themes/twentyfourteen/sidebar-content.php @@ -5,29 +5,11 @@ * @package WordPress * @subpackage Twenty_Fourteen */ +if ( ! is_active_sidebar( 'sidebar-3' ) ) + return; ?>