Ticket #21619: 21619.2.diff
| File 21619.2.diff, 5.1 KB (added by lancewillett, 10 months ago) |
|---|
-
wp-content/themes/twentytwelve/style.css
1435 1435 float: right; 1436 1436 width: 47.916666667%; 1437 1437 } 1438 .page-template-homepage-php .widget-area .widget { 1438 .page-template-homepage-php .widget-area .widget, 1439 .page-template-homepage-php .widget-area.two .home-widgets { 1439 1440 float: left; 1440 1441 width: 51.875%; 1441 1442 margin-bottom: 24px; 1442 1443 margin-bottom: 1.714285714rem; 1443 1444 } 1444 .page-template-homepage-php .widget-area .widget:nth-child(even) { 1445 .page-template-homepage-php .widget-area .widget:nth-child(odd) { 1446 clear: right; 1447 } 1448 .page-template-homepage-php .widget-area .widget:nth-child(even), 1449 .page-template-homepage-php .widget-area.two .home-widgets + .home-widgets { 1445 1450 float: right; 1446 1451 width: 39.0625%; 1447 1452 margin: 0 0 24px; 1448 1453 margin: 0 0 1.714285714rem; 1449 1454 } 1455 .page-template-homepage-php .widget-area.two .widget, 1456 .page-template-homepage-php .widget-area.two .widget:nth-child(even) { 1457 float: none; 1458 width: auto; 1459 } 1450 1460 } 1451 1461 1452 1462 /* Minimum width of 960 pixels. */ -
wp-content/themes/twentytwelve/sidebar-home.php
1 1 <?php 2 2 /** 3 * The Sidebar containing the homepage widget area .3 * The Sidebar containing the homepage widget areas. 4 4 * 5 * If no active widgets in this sidebar, itwill be hidden completely.5 * If no active widgets in either sidebar, they will be hidden completely. 6 6 * 7 7 * @package WordPress 8 8 * @subpackage Twenty_Twelve 9 9 * @since Twenty Twelve 1.0 10 10 */ 11 12 /* 13 The homepage widget area is triggered if any of the areas 14 have widgets. So let's check that first. 15 16 If none of the sidebars have widgets, then let's bail early. 17 */ 18 if ( ! is_active_sidebar( 2 ) && ! is_active_sidebar( 3 ) ) 19 return; 20 21 // If we get this far, we have widgets. Let do this. 11 22 ?> 23 <div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary"> 24 <?php if ( is_active_sidebar( 2 ) ) : ?> 25 <div class="first home-widgets"> 26 <?php dynamic_sidebar( 'sidebar-2' ); ?> 27 </div><!-- .first .home-widgets --> 28 <?php endif; ?> 12 29 13 <?php if ( is_active_sidebar( 'sidebar-home' ) ) : ?> 14 <div id="secondary" class="widget-area" role="complementary"> 15 <?php dynamic_sidebar( 'sidebar-home' ); ?> 16 </div><!-- #secondary .widget-area --> 17 <?php endif; ?> 18 No newline at end of file 30 <?php if ( is_active_sidebar( 3 ) ) : ?> 31 <div class="second home-widgets"> 32 <?php dynamic_sidebar( 'sidebar-3' ); ?> 33 </div><!-- .second .home-widgets --> 34 <?php endif; ?> 35 </div><!-- #secondary .widget-area --> 36 No newline at end of file -
wp-content/themes/twentytwelve/functions.php
183 183 register_sidebar( array( 184 184 'name' => __( 'Main Sidebar', 'twentytwelve' ), 185 185 'id' => 'sidebar-1', 186 'description' => __( 'Appears on posts and pages except the optional Homepage template, which uses its own set ofwidgets', 'twentytwelve' ),186 'description' => __( 'Appears on posts and pages except the optional Homepage template, which has its own widgets', 'twentytwelve' ), 187 187 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 188 188 'after_widget' => '</aside>', 189 189 'before_title' => '<h3 class="widget-title">', … … 191 191 ) ); 192 192 193 193 register_sidebar( array( 194 'name' => __( 'Homepage Widgets ', 'twentytwelve' ),195 'id' => 'sidebar- home',194 'name' => __( 'Homepage Widgets One', 'twentytwelve' ), 195 'id' => 'sidebar-2', 196 196 'description' => __( 'Appears when using the optional homepage template with a page set as Static Front Page', 'twentytwelve' ), 197 197 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 198 198 'after_widget' => '</aside>', 199 199 'before_title' => '<h3 class="widget-title">', 200 200 'after_title' => '</h3>', 201 201 ) ); 202 203 register_sidebar( array( 204 'name' => __( 'Homepage Widgets Two', 'twentytwelve' ), 205 'id' => 'sidebar-3', 206 'description' => __( 'Appears when using the optional homepage template with a page set as Static Front Page', 'twentytwelve' ), 207 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 208 'after_widget' => '</aside>', 209 'before_title' => '<h3 class="widget-title">', 210 'after_title' => '</h3>', 211 ) ); 202 212 } 203 213 add_action( 'widgets_init', 'twentytwelve_widgets_init' ); 204 214 215 /** 216 * Count the number of footer sidebars to enable dynamic classes for the footer 217 * 218 * @since Twenty Twelve 1.0 219 */ 220 function twentytwelve_homepage_sidebar_class() { 221 $classes = array( 'widget-area' ); 222 223 if ( is_active_sidebar( 2 ) && is_active_sidebar( 3 ) ) 224 $classes[] = 'two'; 225 226 echo 'class="' . implode( ' ', $classes ) . '"'; 227 } 228 205 229 if ( ! function_exists( 'twentytwelve_content_nav' ) ) : 206 230 /** 207 231 * Display navigation to next/previous pages when applicable.