Make WordPress Core

Ticket #21245: 21245.diff

File 21245.diff, 4.3 KB (added by obenland, 12 years ago)
  • wp-content/themes/twentytwelve/style.css

     
    13191319-------------------------------------------------------------- */
    13201320
    13211321@media screen and (min-width: 600px) {
    1322         div.home-top,
    1323         div.home-middle {
     1322        .page-template-homepage-php #content,
     1323        .page-template-homepage-php article {
    13241324                zoom: 1;
    13251325        }
    1326         div.home-top:before,
    1327         div.home-top:after,
    1328         div.home-middle:before,
    1329         div.home-middle:after {
     1326        .page-template-homepage-php #content:before,
     1327        .page-template-homepage-php #content:after,
     1328        .page-template-homepage-php article:before,
     1329        .page-template-homepage-php article:after {
    13301330                display: table;
    13311331                content: "";
    13321332        }
    1333         div.home-top:after,
    1334         div.home-middle:after {
     1333        .page-template-homepage-php #content:after,
     1334        .page-template-homepage-php article:after {
    13351335                clear: both;
    13361336        }
    13371337}
    1338 div.home-top {
    1339         margin-bottom: 24px;
    1340         margin-bottom: 1.714285714rem;
     1338.page-template-homepage-php #content article {
     1339        border: 0 none;
     1340        margin: 0;
    13411341}
    13421342@media screen and (min-width: 600px) {
    1343         section.home-content {
    1344                 zoom: 1;
    1345         }
    1346         section.home-content:before,
    1347         section.home-content:after {
    1348                 display: table;
    1349                 content: "";
    1350         }
    1351         section.home-content:after {
    1352                 clear: both;
    1353         }
    1354         section.home-content h1.entry-title {
    1355                 margin: 0 0 24px;
    1356                 margin: 0 0 1.714285714rem;
    1357         }
    1358         section.home-content.thumbnail {
     1343        .page-template-homepage-php.has-thumbnail article {
    13591344                float: left;
    13601345                width: 47.916666667%;
    13611346        }
    1362 }
    1363 @media screen and (min-width: 600px) {
    13641347        .entry-page-image {
    13651348                float: right;
    13661349                width: 47.916666667%;
    1367                 margin-bottom: 24px;
    1368                 margin-bottom: 1.714285714rem;
    13691350        }
    13701351}
    1371 @media screen and (min-width: 600px) {
    1372         .page-template-homepage-php #content {
    1373                 zoom: 1;
    1374         }
    1375         .page-template-homepage-php #content:before,
    1376         .page-template-homepage-php #content:after {
    1377                 display: table;
    1378                 content: "";
    1379         }
    1380         .page-template-homepage-php #content:after {
    1381                 clear: both;
    1382         }
     1352.entry-page-image {
     1353        margin-bottom: 24px;
     1354        margin-bottom: 1.714285714rem;
    13831355}
    13841356.page-template-homepage-php #secondary {
    13851357        clear: both;
  • wp-content/themes/twentytwelve/functions.php

     
    300300endif;
    301301
    302302/**
    303  * Extends the default WordPress body class to denote a full-width layout.
    304  *
    305  * Used in two cases: no active widgets in sidebar, and full-width page template.
     303 * Extends the default WordPress body class to denote a thumbnail in the
     304 * Homepage page template.
    306305 *
    307306 * @since Twenty Twelve 1.0
    308307 */
    309308function twentytwelve_body_class( $classes ) {
    310         if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width' ) )
    311                 $classes[] = 'full-width';
     309        if ( is_page_template( 'homepage.php' ) && has_post_thumbnail() )
     310                $classes[] = 'has-thumbnail';
    312311
    313312        return $classes;
    314313}
  • wp-content/themes/twentytwelve/homepage.php

     
    1212        <div id="primary">
    1313                <div id="content" role="main">
    1414
    15                         <div class="home-top">
    16                                 <?php while ( have_posts() ) : the_post(); ?>
    17                                         <?php if ( has_post_thumbnail() ) { ?>
    18                                                 <div class="entry-page-image">
    19                                                         <?php the_post_thumbnail(); ?>
    20                                                 </div>
    21                                         <?php } ?>
    22                                         <section class="home-content<?php echo ( has_post_thumbnail() ) ? ' thumbnail' : ''; ?>">
    23                                                 <div class="entry-content">
    24                                                         <header class="entry-header">
    25                                                                 <h1 class="entry-title"><?php the_title(); ?></h1>
    26                                                         </header><!-- .entry-header -->
    27                                                         <?php the_content(); ?>
    28                                                 </div><!-- .entry-content -->
    29                                         </section>
    30                                 <?php endwhile; // end of the loop. ?>
    31                         </div><!-- .home-top -->
     15                        <?php while ( have_posts() ) : the_post(); ?>
     16                                <?php if ( has_post_thumbnail() ) { ?>
     17                                        <div class="entry-page-image">
     18                                                <?php the_post_thumbnail(); ?>
     19                                        </div>
     20                                <?php } ?>
    3221
     22                                <?php get_template_part( 'content', 'page' ); ?>
     23                               
     24                        <?php endwhile; // end of the loop. ?>
     25                       
    3326                </div><!-- #content -->
    3427        </div><!-- #primary -->
    3528