Ticket #24874: 24874.patch
| File 24874.patch, 7.4 KB (added by , 13 years ago) |
|---|
-
wp-content/themes/twentyfourteen/style.css
500 500 } 501 501 502 502 /* Clearing floats */ 503 #footer-sidebar:after, 503 504 .clearfix:after { 504 505 clear: both; 505 506 } 507 #footer-sidebar:before, 508 #footer-sidebar:after, 506 509 .clearfix:before, 507 510 .clearfix:after { 508 511 display: table; … … 2484 2487 -moz-box-sizing: border-box; 2485 2488 box-sizing: border-box; 2486 2489 } 2490 #footer-sidebar .widget { 2491 float: left; 2492 padding-left: 27px; 2493 width: 198px; 2494 } 2487 2495 2488 2489 2496 /* =Jetpack 2490 2497 ----------------------------------------------- */ 2491 2498 … … 3260 3267 padding-right: 0; 3261 3268 padding-left: 0; 3262 3269 } 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 3283 3271 } 3284 3272 3285 3273 @media screen and (min-width: 1150px) { … … 3379 3367 .full-width .commentlist li.pingback { 3380 3368 padding-right: 0; 3381 3369 } 3382 } 3383 No newline at end of file 3370 } -
wp-content/themes/twentyfourteen/js/theme.js
123 123 } 124 124 } ); 125 125 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 126 137 } ); 127 138 128 } )( jQuery ); 129 No newline at end of file 139 } )( jQuery ); -
wp-content/themes/twentyfourteen/sidebar-footer.php
1 1 <?php 2 2 /** 3 * The Sidebar containing the main widget area s.3 * The Sidebar containing the main widget area. 4 4 * 5 5 * @package WordPress 6 6 * @subpackage Twenty_Fourteen 7 7 */ 8 8 ?> 9 9 <?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; 10 if ( ! is_active_sidebar( 'sidebar-3' ) ) 11 return; 17 12 ?> 18 <div id="supplementary" <?php twentyfourteen_footer_sidebar_class(); ?>> 13 <div id="supplementary"> 14 19 15 <?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"> 21 17 <?php dynamic_sidebar( 'sidebar-3' ); ?> 22 18 </div><!-- #first .widget-area --> 23 19 <?php endif; ?> 24 20 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; ?>47 21 </div><!-- #supplementary --> -
wp-content/themes/twentyfourteen/functions.php
148 148 'after_title' => '</h1>', 149 149 ) ); 150 150 register_sidebar( array( 151 'name' => __( 'Footer Widget Area One', 'twentyfourteen' ),151 'name' => __( 'Footer Sidebar.', 'twentyfourteen' ), 152 152 'id' => 'sidebar-3', 153 153 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 154 154 'after_widget' => '</aside>', 155 155 'before_title' => '<h1 class="widget-title">', 156 156 'after_title' => '</h1>', 157 157 ) ); 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 ) );190 158 } 191 159 add_action( 'widgets_init', 'twentyfourteen_widgets_init' ); 192 160 … … 223 191 wp_enqueue_script( 'twentyfourteen-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array( 'jquery' ), '20130402' ); 224 192 } 225 193 194 if ( is_active_sidebar( 'sidebar-3' ) ) { 195 wp_enqueue_script( 'jquery-masonry' ); 196 } 197 226 198 wp_enqueue_script( 'twentyfourteen-theme', get_template_directory_uri() . '/js/theme.js', array( 'jquery' ), '20130402', true ); 227 199 } 228 200 add_action( 'wp_enqueue_scripts', 'twentyfourteen_scripts' ); … … 286 258 add_filter( 'get_the_excerpt', 'twentyfourteen_custom_excerpt_more' ); 287 259 288 260 /** 289 * Count the number of footer sidebars to enable dynamic classes for the footer290 *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 /**335 261 * Gets recent formatted posts that are not featured in FC plugin. 336 262 * 337 263 */ … … 443 369 444 370 return $title; 445 371 } 446 add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 ); 447 No newline at end of file 372 add_filter( 'wp_title', 'twentyfourteen_wp_title', 10, 2 );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)