Make WordPress Core

Ticket #24874: 24874.patch

File 24874.patch, 7.4 KB (added by anonymized_8769252, 13 years ago)
  • wp-content/themes/twentyfourteen/style.css

     
    500500}
    501501
    502502/* Clearing floats */
     503#footer-sidebar:after,
    503504.clearfix:after {
    504505        clear: both;
    505506}
     507#footer-sidebar:before,
     508#footer-sidebar:after,
    506509.clearfix:before,
    507510.clearfix:after {
    508511        display: table;
     
    24842487        -moz-box-sizing: border-box;
    24852488        box-sizing: border-box;
    24862489}
     2490#footer-sidebar .widget {
     2491        float: left;
     2492        padding-left: 27px;
     2493        width: 198px;
     2494}
    24872495
    2488 
    24892496/* =Jetpack
    24902497----------------------------------------------- */
    24912498
     
    32603267                padding-right: 0;
    32613268                padding-left: 0;
    32623269        }
    3263         #supplementary .widget-area {
    3264                 float: left;
    3265                 padding: 0 27px;
    3266                 padding: 0 2.7rem;
    3267         }
    3268         #supplementary.one .widget-area {
    3269                 width: 100%;
    3270         }
    3271         #supplementary.two .widget-area {
    3272                 width: 50%;
    3273         }
    3274         #supplementary.three .widget-area {
    3275                 width: 33.33333333%;
    3276         }
    3277         #supplementary.four .widget-area {
    3278                 width: 25%;
    3279         }
    3280         #supplementary.five .widget-area {
    3281                 width: 20%;
    3282         }
     3270
    32833271}
    32843272
    32853273@media screen and (min-width: 1150px) {
     
    33793367        .full-width .commentlist li.pingback {
    33803368                padding-right: 0;
    33813369        }
    3382 }
    3383  No newline at end of file
     3370}
  • wp-content/themes/twentyfourteen/js/theme.js

     
    123123                        }
    124124                } );
    125125
     126                // Arranges footer widgets vertically.
     127                if ( $.isFunction( $.fn.masonry ) ) {
     128
     129                        $( '#supplementary .widget-area' ).masonry( {
     130                                itemSelector: '.widget',
     131                                columnWidth: 225,
     132                                gutterWidth: 27,
     133                                isRTL: $( 'body' ).is( '.rtl' )
     134                        } );
     135                }
     136
    126137        } );
    127138
    128 } )( jQuery );
    129  No newline at end of file
     139} )( jQuery );
  • wp-content/themes/twentyfourteen/sidebar-footer.php

     
    11<?php
    22/**
    3  * The Sidebar containing the main widget areas.
     3 * The Sidebar containing the main widget area.
    44 *
    55 * @package WordPress
    66 * @subpackage Twenty_Fourteen
    77 */
    88?>
    99<?php
    10         if (   ! is_active_sidebar( 'sidebar-3' )
    11                 && ! is_active_sidebar( 'sidebar-4' )
    12                 && ! is_active_sidebar( 'sidebar-5' )
    13                 && ! is_active_sidebar( 'sidebar-6' )
    14                 && ! is_active_sidebar( 'sidebar-7' )
    15         )
    16                 return;
     10if (   ! is_active_sidebar( 'sidebar-3' ) )
     11        return;
    1712?>
    18 <div id="supplementary" <?php twentyfourteen_footer_sidebar_class(); ?>>
     13<div id="supplementary">
     14
    1915        <?php if ( is_active_sidebar( 'sidebar-3' ) ) : ?>
    20         <div id="footer-sidebar-one" class="widget-area" role="complementary">
     16        <div id="footer-sidebar" class="widget-area" role="complementary">
    2117                <?php dynamic_sidebar( 'sidebar-3' ); ?>
    2218        </div><!-- #first .widget-area -->
    2319        <?php endif; ?>
    2420
    25         <?php if ( is_active_sidebar( 'sidebar-4' ) ) : ?>
    26         <div id="footer-sidebar-two" class="widget-area" role="complementary">
    27                 <?php dynamic_sidebar( 'sidebar-4' ); ?>
    28         </div><!-- #second .widget-area -->
    29         <?php endif; ?>
    30 
    31         <?php if ( is_active_sidebar( 'sidebar-5' ) ) : ?>
    32         <div id="footer-sidebar-three" class="widget-area" role="complementary">
    33                 <?php dynamic_sidebar( 'sidebar-5' ); ?>
    34         </div><!-- #third .widget-area -->
    35         <?php endif; ?>
    36 
    37         <?php if ( is_active_sidebar( 'sidebar-6' ) ) : ?>
    38         <div id="footer-sidebar-four" class="widget-area" role="complementary">
    39                 <?php dynamic_sidebar( 'sidebar-6' ); ?>
    40         </div><!-- #fourth .widget-area -->
    41         <?php endif; ?>
    42         <?php if ( is_active_sidebar( 'sidebar-7' ) ) : ?>
    43         <div id="footer-sidebar-five" class="widget-area" role="complementary">
    44                 <?php dynamic_sidebar( 'sidebar-7' ); ?>
    45         </div><!-- #fourth .widget-area -->
    46         <?php endif; ?>
    4721</div><!-- #supplementary -->
  • wp-content/themes/twentyfourteen/functions.php

     
    148148                'after_title' => '</h1>',
    149149        ) );
    150150        register_sidebar( array(
    151                 'name' => __( 'Footer Widget Area One', 'twentyfourteen' ),
     151                'name' => __( 'Footer Sidebar.', 'twentyfourteen' ),
    152152                'id' => 'sidebar-3',
    153153                'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    154154                'after_widget' => '</aside>',
    155155                'before_title' => '<h1 class="widget-title">',
    156156                'after_title' => '</h1>',
    157157        ) );
    158         register_sidebar( array(
    159                 'name' => __( 'Footer Widget Area Two', 'twentyfourteen' ),
    160                 'id' => 'sidebar-4',
    161                 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    162                 'after_widget' => '</aside>',
    163                 'before_title' => '<h1 class="widget-title">',
    164                 'after_title' => '</h1>',
    165         ) );
    166         register_sidebar( array(
    167                 'name' => __( 'Footer Widget Area Three', 'twentyfourteen' ),
    168                 'id' => 'sidebar-5',
    169                 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    170                 'after_widget' => '</aside>',
    171                 'before_title' => '<h1 class="widget-title">',
    172                 'after_title' => '</h1>',
    173         ) );
    174         register_sidebar( array(
    175                 'name' => __( 'Footer Widget Area Four', 'twentyfourteen' ),
    176                 'id' => 'sidebar-6',
    177                 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    178                 'after_widget' => '</aside>',
    179                 'before_title' => '<h1 class="widget-title">',
    180                 'after_title' => '</h1>',
    181         ) );
    182         register_sidebar( array(
    183                 'name' => __( 'Footer Widget Area Five', 'twentyfourteen' ),
    184                 'id' => 'sidebar-7',
    185                 'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    186                 'after_widget' => '</aside>',
    187                 'before_title' => '<h1 class="widget-title">',
    188                 'after_title' => '</h1>',
    189         ) );
    190158}
    191159add_action( 'widgets_init', 'twentyfourteen_widgets_init' );
    192160
     
    223191                wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' );
    224192        }
    225193
     194        if ( is_active_sidebar( 'sidebar-3' ) ) {
     195                wp_enqueue_script( 'jquery-masonry' );
     196        }
     197
    226198        wp_enqueue_script( 'twentyfourteen-theme', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20130402', true );
    227199}
    228200add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' );
     
    286258add_filter( 'get_the_excerpt', 'twentyfourteen_custom_excerpt_more' );
    287259
    288260/**
    289  * Count the number of footer sidebars to enable dynamic classes for the footer
    290  *
    291  */
    292 function twentyfourteen_footer_sidebar_class() {
    293         $count = 0;
    294 
    295         if ( is_active_sidebar( 'sidebar-3' ) )
    296                 $count++;
    297 
    298         if ( is_active_sidebar( 'sidebar-4' ) )
    299                 $count++;
    300 
    301         if ( is_active_sidebar( 'sidebar-5' ) )
    302                 $count++;
    303 
    304         if ( is_active_sidebar( 'sidebar-6' ) )
    305                 $count++;
    306 
    307         if ( is_active_sidebar( 'sidebar-7' ) )
    308                 $count++;
    309 
    310         $class = '';
    311 
    312         switch ( $count ) {
    313                 case '1':
    314                         $class = 'one';
    315                         break;
    316                 case '2':
    317                         $class = 'two';
    318                         break;
    319                 case '3':
    320                         $class = 'three';
    321                         break;
    322                 case '4':
    323                         $class = 'four';
    324                         break;
    325                 case '5':
    326                         $class = 'five';
    327                         break;
    328         }
    329 
    330         if ( $class )
    331                 echo 'class="clearfix ' . $class . '"';
    332 }
    333 
    334 /**
    335261 * Gets recent formatted posts that are not featured in FC plugin.
    336262 *
    337263 */
     
    443369
    444370        return $title;
    445371}
    446 add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );
    447  No newline at end of file
     372add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );