Make WordPress Core

Ticket #25389: 25389.2.diff

File 25389.2.diff, 1.3 KB (added by taupecat, 11 years ago)

Supercedes 25389.diff; tests for presence of footer widgets and only applies min-height if no footer widgets exist.

  • wp-content/themes/twentyfourteen/functions.php

    diff --git wp-content/themes/twentyfourteen/functions.php wp-content/themes/twentyfourteen/functions.php
    index 28ef45c..d70a8f3 100644
    add_action( 'pre_get_posts', 'twentyfourteen_pre_get_posts' ); 
    459459 * 1. Single or multiple authors.
    460460 * 2. Index views.
    461461 * 3. Full-width content layout.
     462 * 4. Absence of footer widgets.
    462463 *
    463464 * @param array $classes A list of existing body class values.
    464465 * @return array The filtered body class list.
    function twentyfourteen_body_classes( $classes ) { 
    476477                || is_attachment() )
    477478                $classes[] = 'full-width';
    478479
     480        if ( ! is_active_sidebar( 'sidebar-4' ) )
     481                $classes[] = 'no-footer-widgets';
     482
    479483        return $classes;
    480484}
    481485add_filter( 'body_class', 'twentyfourteen_body_classes' );
  • wp-content/themes/twentyfourteen/style.css

    diff --git wp-content/themes/twentyfourteen/style.css wp-content/themes/twentyfourteen/style.css
    index a42f93a..e055c0d 100644
    span > object { 
    25472547                padding: 0 27px;
    25482548                width: 128px;
    25492549        }
     2550        body.no-footer-widgets #secondary {
     2551                min-height: 100vh;
     2552        }
    25502553        .site-description {
    25512554                display: block;
    25522555                line-height: 1.6363636363;