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
This commit is contained in:
parent
fcd1b02a1d
commit
11a9f047cc
@ -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;
|
||||
|
@ -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 -->
|
||||
|
Loading…
Reference in New Issue
Block a user