Make WordPress Core


Ignore:
Timestamp:
08/20/2012 06:45:00 PM (12 years ago)
Author:
lancewillett
Message:

Twenty Twelve: change homepage widget areas to use columns or multiple areas instead of one big area. Fixes #21619, props obenland.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentytwelve/sidebar-home.php

    r21261 r21555  
    11<?php
    22/**
    3  * The Sidebar containing the homepage widget area.
     3 * The Sidebar containing the homepage widget areas.
    44 *
    5  * If no active widgets in this sidebar, it will be hidden completely.
     5 * If no active widgets in either sidebar, they will be hidden completely.
    66 *
    77 * @package WordPress
     
    99 * @since Twenty Twelve 1.0
    1010 */
     11
     12/*
     13The homepage widget area is triggered if any of the areas
     14have widgets. So let's check that first.
     15
     16If none of the sidebars have widgets, then let's bail early.
     17*/
     18if ( ! is_active_sidebar( 2 ) && ! is_active_sidebar( 3 ) )
     19    return;
     20
     21// If we get this far, we have widgets. Let do this.
    1122?>
     23<div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary">
     24    <?php if ( is_active_sidebar( 2 ) ) : ?>
     25    <div class="first home-widgets">
     26        <?php dynamic_sidebar( 'sidebar-2' ); ?>
     27    </div><!-- .first .home-widgets -->
     28    <?php endif; ?>
    1229
    13     <?php if ( is_active_sidebar( 'sidebar-home' ) ) : ?>
    14         <div id="secondary" class="widget-area" role="complementary">
    15             <?php dynamic_sidebar( 'sidebar-home' ); ?>
    16         </div><!-- #secondary .widget-area -->
     30    <?php if ( is_active_sidebar( 3 ) ) : ?>
     31    <div class="second home-widgets">
     32        <?php dynamic_sidebar( 'sidebar-3' ); ?>
     33    </div><!-- .second .home-widgets -->
    1734    <?php endif; ?>
     35</div><!-- #secondary .widget-area -->
Note: See TracChangeset for help on using the changeset viewer.