From b761edc1987d52bee2c063780f2fef80bbf279f6 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Thu, 24 Oct 2013 22:57:34 +0000 Subject: [PATCH] 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@25856 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfourteen/functions.php | 4 ++-- wp-content/themes/twentyfourteen/inc/template-tags.php | 4 ++++ wp-content/themes/twentyfourteen/style.css | 7 ++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index 941a7e9604..95e1a1f411 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -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' ); diff --git a/wp-content/themes/twentyfourteen/inc/template-tags.php b/wp-content/themes/twentyfourteen/inc/template-tags.php index e2c00754db..abdd64fd76 100644 --- a/wp-content/themes/twentyfourteen/inc/template-tags.php +++ b/wp-content/themes/twentyfourteen/inc/template-tags.php @@ -80,8 +80,12 @@ function twentyfourteen_post_nav() {

diff --git a/wp-content/themes/twentyfourteen/style.css b/wp-content/themes/twentyfourteen/style.css index e0af550b3c..7a1c8cb8a8 100644 --- a/wp-content/themes/twentyfourteen/style.css +++ b/wp-content/themes/twentyfourteen/style.css @@ -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;