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.

Built from https://develop.svn.wordpress.org/trunk@25624


git-svn-id: http://core.svn.wordpress.org/trunk@25541 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-09-25 16:36:09 +00:00
parent 107163d578
commit 881c87cc51
2 changed files with 7 additions and 22 deletions

View File

@ -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;

View File

@ -5,29 +5,11 @@
* @package WordPress
* @subpackage Twenty_Fourteen
*/
if ( ! is_active_sidebar( 'sidebar-3' ) )
return;
?>
<div id="content-sidebar" class="content-sidebar widget-area" role="complementary">
<?php do_action( 'before_sidebar' ); ?>
<?php if ( ! dynamic_sidebar( 'sidebar-3' ) ) : ?>
<aside id="search" class="widget widget_search">
<?php get_search_form(); ?>
</aside>
<aside id="link" class="widget widget_links">
<h1 class="widget-title"><?php _e( 'Blogroll', 'twentyfourteen' ); ?></h1>
<ul class="xoxo blogroll">
<?php wp_list_bookmarks( array( 'title_li' => '', 'categorize' => 0 ) ); ?>
</ul>
</aside>
<aside id="meta" class="widget">
<h1 class="widget-title"><?php _e( 'Meta', 'twentyfourteen' ); ?></h1>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
<?php dynamic_sidebar( 'sidebar-3' ); ?>
</div><!-- #content-sidebar -->