Make WordPress Core


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

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

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.