Twenty Fourteen: fix non-image attachment page layout, props iamtakashi. Fixes #25624.

Built from https://develop.svn.wordpress.org/trunk@25856


git-svn-id: http://core.svn.wordpress.org/trunk@25768 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Lance Willett 2013-10-21 16:35:09 +00:00
parent 74a2b63958
commit cde77ec4ea
3 changed files with 12 additions and 3 deletions

View File

@ -118,14 +118,14 @@ endif; // twentyfourteen_setup
add_action( 'after_setup_theme', 'twentyfourteen_setup' );
/**
* Adjust content_width value for full-width and attachment templates.
* Adjust content_width value for image attachment template.
*
* @since Twenty Fourteen 1.0
*
* @return void
*/
function twentyfourteen_content_width() {
if ( is_attachment() )
if ( is_attachment() && wp_attachment_is_image() )
$GLOBALS['content_width'] = 810;
}
add_action( 'template_redirect', 'twentyfourteen_content_width' );

View File

@ -80,8 +80,12 @@ function twentyfourteen_post_nav() {
<h1 class="screen-reader-text"><?php _e( 'Post navigation', 'twentyfourteen' ); ?></h1>
<div class="nav-links">
<?php
if ( is_attachment() ) :
previous_post_link( '%link', __( '<span class="meta-nav">Published In</span>%title', 'twentyfourteen' ) );
else :
previous_post_link( '%link', __( '<span class="meta-nav">Previous Post</span>%title', 'twentyfourteen' ) );
next_post_link( '%link', __( '<span class="meta-nav">Next Post</span>%title', 'twentyfourteen' ) );
endif;
?>
</div><!-- .nav-links -->
</nav><!-- .navigation -->

View File

@ -1732,6 +1732,10 @@ span + .edit-link:before,
* -----------------------------------------------------------------------------
*/
.attachment .content-sidebar {
display: none;
}
.attachment .entry-content {
padding-top: 0;
}
@ -1739,6 +1743,7 @@ span + .edit-link:before,
.attachment footer.entry-meta {
text-transform: none;
}
.entry-attachment .attachment {
margin-bottom: 24px;
}
@ -2961,7 +2966,7 @@ span + .edit-link:before,
margin-right: -168px;
}
.attachment .entry-content .attachment {
.attachment .entry-attachment .attachment {
margin-right: -168px;
margin-left: -168px;
max-width: 810px;