Twenty Thirteen: make footer widget area the primary sidebar, acting as "secondary" content. Move optional sidebar widget area to "tertiary" content. Props obenland, fixes #23644.

git-svn-id: https://develop.svn.wordpress.org/trunk@23539 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Lance Willett 2013-02-28 21:35:26 +00:00
parent dc778a96a5
commit a72c418fcc
5 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,7 @@
</div><!-- #main -->
<footer id="colophon" class="site-footer" role="contentinfo">
<?php get_sidebar( 'footer' ); ?>
<?php get_sidebar( 'main' ); ?>
<div class="site-info">
<?php do_action( 'twentythirteen_credits' ); ?>

View File

@ -169,7 +169,7 @@ function twentythirteen_scripts_styles() {
wp_enqueue_script( 'comment-reply' );
// Adds Masonry to handle vertical alignment of footer widgets.
if ( is_active_sidebar( 'sidebar-2' ) )
if ( is_active_sidebar( 'sidebar-1' ) )
wp_enqueue_script( 'jquery-masonry' );
// Loads JavaScript file with functionality specific to Twenty Thirteen.
@ -225,9 +225,9 @@ add_filter( 'wp_title', 'twentythirteen_wp_title', 10, 2 );
*/
function twentythirteen_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'twentythirteen' ),
'name' => __( 'Main Widget Area', 'twentythirteen' ),
'id' => 'sidebar-1',
'description' => __( 'Appears on posts and pages', 'twentythirteen' ),
'description' => __( 'Appears in the footer section of the site', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
@ -235,9 +235,9 @@ function twentythirteen_widgets_init() {
) );
register_sidebar( array(
'name' => __( 'Footer Widget Area', 'twentythirteen' ),
'name' => __( 'Secondary Widget Area', 'twentythirteen' ),
'id' => 'sidebar-2',
'description' => __( 'Appears in the footer section of the site', 'twentythirteen' ),
'description' => __( 'Appears on posts and pages in the sidebar.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
'before_title' => '<h3 class="widget-title">',
@ -505,7 +505,7 @@ function twentythirteen_body_class( $classes ) {
if ( ! is_multi_author() )
$classes[] = 'single-author';
if ( is_active_sidebar( 'sidebar-1' ) && ! is_attachment() && ! is_404() )
if ( is_active_sidebar( 'sidebar-2' ) && ! is_attachment() && ! is_404() )
$classes[] = 'sidebar';
return $classes;

View File

@ -92,7 +92,7 @@
if ( $.isFunction( $.fn.masonry ) ) {
var columnWidth = $( 'body' ).is( '.sidebar' ) ? 228 : 245;
$( '#tertiary .widget-area' ).masonry( {
$( '#secondary .widget-area' ).masonry( {
itemSelector: '.widget',
columnWidth: columnWidth,
gutterWidth: 20

View File

@ -9,10 +9,10 @@
* @since Twenty Thirteen 1.0
*/
if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
<div id="tertiary" class="sidebar-container" role="complementary">
if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<div id="secondary" class="sidebar-container" role="complementary">
<div class="widget-area">
<?php dynamic_sidebar( 'sidebar-2' ); ?>
<?php dynamic_sidebar( 'sidebar-1' ); ?>
</div>
</div><!-- #tertiary -->
</div><!-- #secondary -->
<?php endif; ?>

View File

@ -1,6 +1,6 @@
<?php
/**
* The sidebar containing the main widget area.
* The sidebar containing the secondary widget area, displays on posts and pages.
*
* If no active widgets in this sidebar, it will be hidden completely.
*
@ -9,12 +9,12 @@
* @since Twenty Thirteen 1.0
*/
if ( is_active_sidebar( 'sidebar-1' ) ) : ?>
<div id="secondary" class="sidebar-container" role="complementary">
if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
<div id="tertiary" class="sidebar-container" role="complementary">
<div class="sidebar-inner">
<div class="widget-area">
<?php dynamic_sidebar( 'sidebar-1' ); ?>
<?php dynamic_sidebar( 'sidebar-2' ); ?>
</div>
</div>
</div><!-- #secondary -->
</div><!-- #tertiary -->
<?php endif; ?>