Make WordPress Core

Changeset 21975


Ignore:
Timestamp:
09/24/2012 04:57:42 PM (14 years ago)
Author:
lancewillett
Message:

Twenty Twelve: remove twentytwelve_frontpage_sidebar_class() and make front page sidebar number filterable via body_class. Fixes #21942.

Location:
trunk/wp-content/themes/twentytwelve
Files:
4 edited

Legend:

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

    r21929 r21975  
    216216}
    217217add_action( 'widgets_init', 'twentytwelve_widgets_init' );
    218 
    219 /**
    220  * Counts the number of footer sidebars to enable dynamic classes for the footer.
    221  *
    222  * @since Twenty Twelve 1.0
    223  */
    224 function twentytwelve_frontpage_sidebar_class() {
    225         $classes = array( 'widget-area' );
    226 
    227         if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
    228                 $classes[] = 'two';
    229 
    230         echo 'class="' . implode( ' ', $classes ) . '"';
    231 }
    232218
    233219if ( ! function_exists( 'twentytwelve_content_nav' ) ) :
    … …  
    365351 * 1. Using a full-width layout, when no active widgets in the sidebar
    366352 *    or full-width template.
    367  * 2. A thumbnail in the Front Page template.
     353 * 2. Front Page template: thumbnail in use and number of sidebars for
     354 *    widget areas.
    368355 * 3. White or empty background color to change the layout and spacing.
     356 * 4. Custom fonts enabled.
     357 * 5. Single or multiple authors.
    369358 *
    370359 * @since Twenty Twelve 1.0
    … …  
    383372                if ( has_post_thumbnail() )
    384373                        $classes[] = 'has-post-thumbnail';
     374                if ( is_active_sidebar( 'sidebar-2' ) && is_active_sidebar( 'sidebar-3' ) )
     375                        $classes[] = 'two-sidebars';
    385376        }
    386377
  • trunk/wp-content/themes/twentytwelve/rtl.css

    r21941 r21975  
    200200        }
    201201        .template-front-page .widget-area .widget,
    202         .template-front-page .widget-area.two .front-widgets {
     202        .template-front-page.two-sidebars .widget-area .front-widgets {
    203203                float: right;
    204204        }
    … …  
    207207        }
    208208        .template-front-page .widget-area .widget:nth-child(even),
    209         .template-front-page .widget-area.two .front-widgets + .front-widgets {
     209        .template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets {
    210210                float: left;
    211211                margin: 0 24px 0;
  • trunk/wp-content/themes/twentytwelve/sidebar-front.php

    r21886 r21975  
    2121// If we get this far, we have widgets. Let do this.
    2222?>
    23 <div id="secondary" <?php twentytwelve_frontpage_sidebar_class(); ?> role="complementary">
     23<div id="secondary" class="widget-area" role="complementary">
    2424        <?php if ( is_active_sidebar( 'sidebar-2' ) ) : ?>
    2525        <div class="first front-widgets">
  • trunk/wp-content/themes/twentytwelve/style.css

    r21941 r21975  
    14751475        }
    14761476        .template-front-page .widget-area .widget,
    1477         .template-front-page .widget-area.two .front-widgets {
     1477        .template-front-page.two-sidebars .widget-area .front-widgets {
    14781478                float: left;
    14791479                width: 51.875%;
    … …  
    14851485        }
    14861486        .template-front-page .widget-area .widget:nth-child(even),
    1487         .template-front-page .widget-area.two .front-widgets + .front-widgets {
     1487        .template-front-page.two-sidebars .widget-area .front-widgets + .front-widgets {
    14881488                float: right;
    14891489                width: 39.0625%;
    … …  
    14911491                margin: 0 0 1.714285714rem;
    14921492        }
    1493         .template-front-page .widget-area.two .widget,
    1494         .template-front-page .widget-area.two .widget:nth-child(even) {
     1493        .template-front-page.two-sidebars .widget,
     1494        .template-front-page.two-sidebars .widget:nth-child(even) {
    14951495                float: none;
    14961496                width: auto;
Note: See TracChangeset for help on using the changeset viewer.