From 6df629fb0284a907f5d5aec7198464b8a4a8b55c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 28 Feb 2014 21:57:13 +0000 Subject: [PATCH] in TwentyFourteen: don't add the `has-post-thumbnail` class or print the featured image when viewing an attachment. See #27243. Built from https://develop.svn.wordpress.org/trunk@27330 git-svn-id: http://core.svn.wordpress.org/trunk@27182 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfourteen/functions.php | 2 +- wp-content/themes/twentyfourteen/inc/template-tags.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/twentyfourteen/functions.php b/wp-content/themes/twentyfourteen/functions.php index 51e1b48e26..41f179a457 100644 --- a/wp-content/themes/twentyfourteen/functions.php +++ b/wp-content/themes/twentyfourteen/functions.php @@ -461,7 +461,7 @@ add_filter( 'body_class', 'twentyfourteen_body_classes' ); * @return array The filtered post class list. */ function twentyfourteen_post_classes( $classes ) { - if ( ! post_password_required() && has_post_thumbnail() ) { + if ( ! post_password_required() && ! is_attachment() && has_post_thumbnail() ) { $classes[] = 'has-post-thumbnail'; } diff --git a/wp-content/themes/twentyfourteen/inc/template-tags.php b/wp-content/themes/twentyfourteen/inc/template-tags.php index dee499e1e2..c911e2a186 100644 --- a/wp-content/themes/twentyfourteen/inc/template-tags.php +++ b/wp-content/themes/twentyfourteen/inc/template-tags.php @@ -175,7 +175,7 @@ add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); * @return void */ function twentyfourteen_post_thumbnail() { - if ( post_password_required() || ! has_post_thumbnail() ) { + if ( post_password_required() || is_attachment() || ! has_post_thumbnail() ) { return; }