Ticket #21619: 21619.diff
| File 21619.diff, 3.8 KB (added by obenland, 9 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.two .home-widgets { 1439 1439 float: left; 1440 1440 width: 51.875%; 1441 1441 margin-bottom: 24px; 1442 1442 margin-bottom: 1.714285714rem; 1443 1443 } 1444 .page-template-homepage-php .widget-area .widget:nth-child(even){1444 .page-template-homepage-php .widget-area.two .home-widgets + .home-widgets { 1445 1445 float: right; 1446 1446 width: 39.0625%; 1447 1447 margin: 0 0 24px; -
wp-content/themes/twentytwelve/functions.php
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 'description' => __( 'Appears when using the optional homepage template with a page set as Static Front Page', 'twentytwelve' ), 197 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 198 'after_widget' => '</aside>', 199 'before_title' => '<h3 class="widget-title">', 200 'after_title' => '</h3>', 201 ) ); 202 203 register_sidebar( array( 204 'name' => __( 'Homepage Widgets Two', 'twentytwelve' ), 205 'id' => 'sidebar-3', 196 206 'description' => __( 'Appears when using the optional homepage template with a page set as Static Front Page', 'twentytwelve' ), 197 207 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 198 208 'after_widget' => '</aside>', … … 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. -
wp-content/themes/twentytwelve/sidebar-home.php
8 8 * @subpackage Twenty_Twelve 9 9 * @since Twenty Twelve 1.0 10 10 */ 11 12 /* The homepage widget area is triggered if any of the areas 13 * have widgets. So let's check that first. 14 * 15 * If none of the sidebars have widgets, then let's bail early. 16 */ 17 if ( ! is_active_sidebar( 2 ) && ! is_active_sidebar( 3 ) ) 18 return; 19 20 // If we get this far, we have widgets. Let do this. 11 21 ?> 22 <div id="secondary" <?php twentytwelve_homepage_sidebar_class(); ?> role="complementary"> 23 <?php if ( is_active_sidebar( 2 ) ) : ?> 24 <div class="first home-widgets"> 25 <?php dynamic_sidebar( 'sidebar-2' ); ?> 26 </div><!-- .first .home-widgets --> 27 <?php endif; ?> 12 28 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 29 <?php if ( is_active_sidebar( 3 ) ) : ?> 30 <div class="second home-widgets"> 31 <?php dynamic_sidebar( 'sidebar-3' ); ?> 32 </div><!-- .second .home-widgets --> 33 <?php endif; ?> 34 </div><!-- #secondary .widget-area --> 35 No newline at end of file
