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: http://core.svn.wordpress.org/trunk@23539 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e884e93597
commit
531494b993
|
@ -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' ); ?>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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; ?>
|
|
@ -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; ?>
|
Loading…
Reference in New Issue