Twenty Twelve: Homepage page template logic cleanup and style updates, props obenland. Fixes #21245.
git-svn-id: https://develop.svn.wordpress.org/trunk@21398 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
51b5a97524
commit
5ebd31d51e
@ -338,7 +338,8 @@ endif;
|
||||
* Extends the default WordPress body class to denote:
|
||||
* 1. Using a full-width layout, when no active widgets in the sidebar
|
||||
* or full-width template.
|
||||
* 2. White or empty background color to change the layout and spacing.
|
||||
* 2. A thumbnail in the Homepage page template.
|
||||
* 3. White or empty background color to change the layout and spacing.
|
||||
*
|
||||
* @since Twenty Twelve 1.0
|
||||
*/
|
||||
@ -348,6 +349,9 @@ function twentytwelve_body_class( $classes ) {
|
||||
if ( ! is_active_sidebar( 'sidebar-1' ) || is_page_template( 'full-width-page.php' ) )
|
||||
$classes[] = 'full-width';
|
||||
|
||||
if ( is_page_template( 'homepage.php' ) && has_post_thumbnail() )
|
||||
$classes[] = 'has-post-thumbnail';
|
||||
|
||||
if ( empty( $background_color ) )
|
||||
$classes[] = 'custom-background-empty';
|
||||
elseif ( in_array( $background_color, array( 'fff', 'ffffff' ) ) )
|
||||
|
@ -12,23 +12,16 @@ get_header(); ?>
|
||||
<div id="primary">
|
||||
<div id="content" role="main">
|
||||
|
||||
<div class="home-top">
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<?php if ( has_post_thumbnail() ) { ?>
|
||||
<div class="entry-page-image">
|
||||
<?php the_post_thumbnail(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<section class="home-content<?php echo ( has_post_thumbnail() ) ? ' thumbnail' : ''; ?>">
|
||||
<div class="entry-content">
|
||||
<header class="entry-header">
|
||||
<h1 class="entry-title"><?php the_title(); ?></h1>
|
||||
</header><!-- .entry-header -->
|
||||
<?php the_content(); ?>
|
||||
</div><!-- .entry-content -->
|
||||
</section>
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
</div><!-- .home-top -->
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
<?php if ( has_post_thumbnail() ) { ?>
|
||||
<div class="entry-page-image">
|
||||
<?php the_post_thumbnail(); ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<?php get_template_part( 'content', 'page' ); ?>
|
||||
|
||||
<?php endwhile; // end of the loop. ?>
|
||||
|
||||
</div><!-- #content -->
|
||||
</div><!-- #primary -->
|
||||
|
@ -1318,40 +1318,22 @@ label ~ span.required {
|
||||
/* =Home page template styling
|
||||
-------------------------------------------------------------- */
|
||||
|
||||
@media screen and (min-width: 600px) {
|
||||
div.home-top,
|
||||
div.home-middle {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
div.home-top {
|
||||
margin-bottom: 24px;
|
||||
margin-bottom: 1.714285714rem;
|
||||
.page-template-homepage-php #content article {
|
||||
border: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@media screen and (min-width: 600px) {
|
||||
section.home-content {
|
||||
.page-template-homepage-php #content,
|
||||
.page-template-homepage-php article {
|
||||
overflow: hidden;
|
||||
}
|
||||
section.home-content h1.entry-title {
|
||||
margin: 0 0 24px;
|
||||
margin: 0 0 1.714285714rem;
|
||||
}
|
||||
section.home-content.thumbnail {
|
||||
.page-template-homepage-php.has-post-thumbnail article {
|
||||
float: left;
|
||||
width: 47.916666667%;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 600px) {
|
||||
.entry-page-image {
|
||||
float: right;
|
||||
width: 47.916666667%;
|
||||
margin-bottom: 24px;
|
||||
margin-bottom: 1.714285714rem;
|
||||
}
|
||||
}
|
||||
@media screen and (min-width: 600px) {
|
||||
.page-template-homepage-php #content {
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
.page-template-homepage-php #secondary {
|
||||
|
Loading…
Reference in New Issue
Block a user