From eb01af41c2ba7d31992bd401654718d93899cbb8 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Mon, 28 Oct 2013 17:57:57 +0000 Subject: [PATCH] Twenty Fourteen: clean up post thumbnail naming. Props iamtakashi, fixes #25718. git-svn-id: https://develop.svn.wordpress.org/trunk@25971 602fd350-edb4-49c9-b593-d223f7449a82 --- .../twentyfourteen/content-featured-post.php | 4 +- .../themes/twentyfourteen/functions.php | 22 +++-- .../twentyfourteen/inc/template-tags.php | 10 +- src/wp-content/themes/twentyfourteen/rtl.css | 2 +- .../themes/twentyfourteen/style.css | 94 ++++++++++++++----- 5 files changed, 92 insertions(+), 40 deletions(-) diff --git a/src/wp-content/themes/twentyfourteen/content-featured-post.php b/src/wp-content/themes/twentyfourteen/content-featured-post.php index 7d7099f4d8..23115ac8d5 100644 --- a/src/wp-content/themes/twentyfourteen/content-featured-post.php +++ b/src/wp-content/themes/twentyfourteen/content-featured-post.php @@ -12,7 +12,7 @@ ID, 'featured-thumbnail-featured' ); + echo wp_get_attachment_image( $image->ID, 'post-thumbnail-grid' ); endif; endif; ?> diff --git a/src/wp-content/themes/twentyfourteen/functions.php b/src/wp-content/themes/twentyfourteen/functions.php index 12591ef68f..0f862b5b7c 100644 --- a/src/wp-content/themes/twentyfourteen/functions.php +++ b/src/wp-content/themes/twentyfourteen/functions.php @@ -68,9 +68,8 @@ function twentyfourteen_setup() { add_theme_support( 'post-thumbnails' ); // Add several sizes for Post Thumbnails. - add_image_size( 'featured-thumbnail-large', 672, 0 ); - add_image_size( 'featured-thumbnail-featured', 672, 372, true ); - add_image_size( 'featured-thumbnail-formatted', 306, 0 ); + add_image_size( 'post-thumbnail-grid', 672, 372, true ); + add_image_size( 'post-thumbnail', 672, 0 ); // This theme uses wp_nav_menu() in two locations. register_nav_menus( array( @@ -361,9 +360,11 @@ endif; * * Adds body classes to denote: * 1. Single or multiple authors. - * 2. Index views. - * 3. Full-width content layout. - * 4. Presence of footer widgets. + * 2. Presense of header image. + * 3. Index views. + * 4. Full-width content layout. + * 5. Presence of footer widgets. + * 6. Single views. * * @since Twenty Fourteen 1.0 * @@ -391,6 +392,9 @@ function twentyfourteen_body_classes( $classes ) { if ( is_active_sidebar( 'sidebar-3' ) ) $classes[] = 'footer-widgets'; + if ( is_singular() ) + $classes[] = 'singular'; + return $classes; } add_filter( 'body_class', 'twentyfourteen_body_classes' ); @@ -399,7 +403,7 @@ add_filter( 'body_class', 'twentyfourteen_body_classes' ); * Extend the default WordPress post classes. * * Adds a post class to denote: - * Non-password protected page with a featured image. + * Non-password protected page with a post thumbnail. * * @since Twenty Fourteen 1.0 * @@ -408,7 +412,9 @@ add_filter( 'body_class', 'twentyfourteen_body_classes' ); */ function twentyfourteen_post_classes( $classes ) { if ( ! post_password_required() && has_post_thumbnail() ) - $classes[] = 'has-featured-image'; + $classes[] = 'has-post-thumbnail'; + else + $classes[] = 'no-post-thumbnail'; return $classes; } diff --git a/src/wp-content/themes/twentyfourteen/inc/template-tags.php b/src/wp-content/themes/twentyfourteen/inc/template-tags.php index abdd64fd76..191d77588a 100644 --- a/src/wp-content/themes/twentyfourteen/inc/template-tags.php +++ b/src/wp-content/themes/twentyfourteen/inc/template-tags.php @@ -159,7 +159,7 @@ add_action( 'edit_category', 'twentyfourteen_category_transient_flusher' ); add_action( 'save_post', 'twentyfourteen_category_transient_flusher' ); /** - * Displays an optional featured image, with an anchor element + * Displays an optional post thumbnail, with an anchor element * when on index views, and a div element when on a single view. * * @return void @@ -171,15 +171,15 @@ function twentyfourteen_post_thumbnail() { if ( is_singular() ) : ?> -