Twenty Eleven: introduce image post format and miscellaneous style fixes, props matveb and iandstewart - see #17198

git-svn-id: http://svn.automattic.com/wordpress/trunk@17776 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
lancewillett 2011-04-29 22:33:04 +00:00
parent 62edbb753b
commit ee4df1fc1e
3 changed files with 126 additions and 19 deletions

View File

@ -0,0 +1,53 @@
<?php
/**
* @package WordPress
* @subpackage Twenty Eleven
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyeleven' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
<?php if ( comments_open() ) : ?>
<div class="comments-link">
<?php comments_popup_link( __( '<span class="leave-reply">Reply</span>', 'twentyeleven' ), __( '1', 'twentyeleven' ), __( '%', 'twentyeleven' ) ); ?>
</div>
<?php endif; ?>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyeleven' ) ); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( '<span>Pages:</span>', 'twentyeleven' ), 'after' => '</div>' ) ); ?>
</div><!-- .entry-content -->
<?php endif; ?>
<footer class="entry-meta">
<?php if ( 'post' == $post->post_type ) : // Hide category and tag text for pages on Search ?>
<div class="entry-meta">
<?php
printf( __( '<a href="%1$s" rel="bookmark"><time class="entry-date" datetime="%2$s" pubdate>%3$s</time></a> <span class="sep"> by </span> <span class="author vcard"><a class="url fn n" href="%4$s" title="%5$s">%6$s</a></span>', 'twentyeleven' ),
get_permalink(),
get_the_date( 'c' ),
get_the_date(),
get_author_posts_url( get_the_author_meta( 'ID' ) ),
sprintf( esc_attr__( 'View all posts by %s', 'twentyeleven' ), get_the_author() ),
get_the_author()
);
?>
</div><!-- .entry-meta -->
<div class="entry-meta">
<span class="cat-links"><span class="entry-utility-prep entry-utility-prep-cat-links"><?php _e( 'Posted in ', 'twentyeleven' ); ?></span><?php the_category( ', ' ); ?></span><br />
<?php the_tags( '<span class="tag-links">' . __( 'Tagged ', 'twentyeleven' ) . '</span>', ', ', '' ); ?><br />
<?php endif; ?>
</div><!-- .entry-meta -->
<?php edit_post_link( __( 'Edit', 'twentyeleven' ), '<span class="edit-link">', '</span>' ); ?>
</footer><!-- #entry-meta -->
</article><!-- #post-<?php the_ID(); ?> -->

View File

@ -99,7 +99,7 @@ function twentyeleven_setup() {
/**
* Add support for an Aside Post Format
*/
add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote' ) );
add_theme_support( 'post-formats', array( 'aside', 'link', 'gallery', 'status', 'quote', 'image' ) );
/**
* Add support for custom backgrounds

View File

@ -219,16 +219,23 @@ body {
.one-column section.featured-post .attachment-small-feature {
border: none;
display: block;
float: none;
margin: 0.625em auto 1.025em;
max-width: 100%;
max-width: 60%;
height: auto;
position: static;
}
.one-column article.feature-image.small {
float: none;
margin: 0 0 1.625em;
width: auto;
padding: 0;
}
.one-column article.feature-image.small .entry-title {
font-size: 20px;
line-height: 1.3em;
}
.one-column article.feature-image.small .entry-summary {
height: 150px;
overflow: hidden;
text-overflow: ellipsis;
padding: 0;
}
.one-column article.feature-image.small .entry-summary a {
left: -9%;
@ -267,7 +274,7 @@ body {
/* Make sure the logo and search form don't collide */
.one-column #branding #searchform {
right: 40px;
top: 1.625em;
top: 4em;
}
/* Talking avatars take up too much room at this size */
.one-column .commentlist > li.comment {
@ -625,7 +632,7 @@ a:hover {
padding: 1.625em 0 0;
}
.page-title {
color: #333;
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
@ -982,6 +989,48 @@ dl.gallery-item {
}
/* =Image
----------------------------------------------- */
.format-image .entry-content {
padding-top: 0.5em;
}
.format-image p {
margin: 0;
}
.format-image footer.entry-meta {
background: #e0e6e8;
margin-right: 2px;
margin-top: -6px;
padding: 20px 30px;
}
.format-image div.entry-meta {
display: inline-block;
float: left;
width: 40%;
}
.format-image div.entry-meta + div.entry-meta {
float: none;
width: 60%;
}
.format-image .wp-caption {
background: #111;
margin-bottom: 0;
max-width: 96%;
padding: 11px;
}
.format-image .wp-caption .wp-caption-text {
color: #ddd;
}
.format-image .wp-caption .wp-caption-text:before {
color: #444;
}
.single .format-image footer.entry-meta {
background: transparent;
padding: 30px 0;
}
/* =error404
----------------------------------------------- */
.error404 #main #searchform {
@ -1020,7 +1069,7 @@ dl.gallery-item {
----------------------------------------------- */
h1.showcase-heading {
color: #333;
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
@ -1153,7 +1202,6 @@ article.feature-image.large .entry-summary {
display: none;
}
section.feature-image.large img {
border-bottom: 1px solid #ddd;
display: block;
height: auto;
max-width: 117.9%;
@ -1175,7 +1223,6 @@ section.feature-image.large img {
}
.featured-posts section.featured-post {
background: #fff;
height: 300px;
left: 0;
margin: 0;
position: absolute;
@ -1433,7 +1480,7 @@ p img,
margin: 0 0 2.2em;
}
.widget-title {
color: #333;
color: #666;
font-size: 10px;
font-weight: 500;
letter-spacing: 0.1em;
@ -1570,7 +1617,7 @@ section.ephemera .entry-title a span {
----------------------------------------------- */
#comments-title {
color: #444;
color: #666;
font-size: 10px;
font-weight: 500;
line-height: 2.6em;
@ -1908,6 +1955,9 @@ p.comment-form-comment {
width: auto;
}
/* Simplify the showcase template */
.page-template-showcase-php .featured-posts {
height: 280px;
}
.page-template-showcase-php section.recent-posts {
float: none;
margin: 0;
@ -1922,19 +1972,23 @@ p.comment-form-comment {
border-bottom: 1px solid #ddd;
}
/* Simplify the showcase template when small feature */
section.featured-post .attachment-small-feature {
section.featured-post .attachment-small-feature,
.one-column section.featured-post .attachment-small-feature {
border: none;
display: block;
float: none;
float: left;
height: auto;
margin: 0.625em auto 1.025em;
max-width: 100%;
max-width: 30%;
position: static;
}
article.feature-image.small {
float: none;
float: right;
margin: 0 0 1.625em;
width: auto;
width: 64%;
}
.one-column article.feature-image.small .entry-summary {
height: auto;
}
article.feature-image.small .entry-summary a {
left: -9%;
@ -2050,7 +2104,7 @@ p.comment-form-comment {
position: relative !important;
}
#branding {
border-top: none;
border-top: none !important;
padding: 0;
}
#branding hgroup {