WordPress.org

Make WordPress Core

Changeset 25624


Ignore:
Timestamp:
09/25/2013 04:35:26 PM (8 years ago)
Author:
lancewillett
Message:

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.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r25519 r25624  
    471471        $classes[] = 'list-view';
    472472
    473     if ( is_page_template( 'full-width-page.php' ) || is_page_template( 'contributor-page.php' ) || is_attachment() )
     473    if ( ( ! is_front_page() && ! is_active_sidebar( 'sidebar-3' ) )
     474        || is_page_template( 'full-width-page.php' )
     475        || is_page_template( 'contributor-page.php' )
     476        || is_attachment() )
    474477        $classes[] = 'full-width';
    475478
  • trunk/src/wp-content/themes/twentyfourteen/sidebar-content.php

    r25090 r25624  
    66 * @subpackage Twenty_Fourteen
    77 */
     8if ( ! is_active_sidebar( 'sidebar-3' ) )
     9    return;
    810?>
    911<div id="content-sidebar" class="content-sidebar widget-area" role="complementary">
    1012    <?php do_action( 'before_sidebar' ); ?>
    1113
    12     <?php if ( ! dynamic_sidebar( 'sidebar-3' ) ) : ?>
    13         <aside id="search" class="widget widget_search">
    14                 <?php get_search_form(); ?>
    15         </aside>
    16 
    17         <aside id="link" class="widget widget_links">
    18             <h1 class="widget-title"><?php _e( 'Blogroll', 'twentyfourteen' ); ?></h1>
    19             <ul class="xoxo blogroll">
    20                 <?php wp_list_bookmarks( array( 'title_li' => '', 'categorize' => 0 ) ); ?>
    21             </ul>
    22         </aside>
    23 
    24         <aside id="meta" class="widget">
    25             <h1 class="widget-title"><?php _e( 'Meta', 'twentyfourteen' ); ?></h1>
    26             <ul>
    27                 <?php wp_register(); ?>
    28                 <li><?php wp_loginout(); ?></li>
    29                 <?php wp_meta(); ?>
    30             </ul>
    31         </aside>
    32     <?php endif; // end sidebar widget area ?>
     14    <?php dynamic_sidebar( 'sidebar-3' ); ?>
    3315</div><!-- #content-sidebar -->
Note: See TracChangeset for help on using the changeset viewer.