From 9193569ce126cecea2bb82a5cc6adacbc21183cb Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Thu, 6 Nov 2014 22:02:48 -0500 Subject: [PATCH 1/3] edge case, 404 to use fallback --- includes/class-displayfeaturedimagegenesis-common.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index 27afe26..230b2ae 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -44,17 +44,19 @@ class Display_Featured_Image_Genesis_Common { $image_id = get_post_thumbnail_id( $postspage ); } // any singular post/page/CPT with either a post_thumbnail larger than medium size OR there is no $item->fallback - elseif ( is_singular() && ( $post_thumbnail[1] > $item->medium || empty( $item->fallback ) ) /*&& ! in_array( get_post_type(), self::use_fallback_image() )*/ ) { + elseif ( is_singular() && ( $post_thumbnail[1] > $item->medium || empty( $item->fallback ) ) && ! in_array( get_post_type(), self::use_fallback_image() ) ) { $image_id = get_post_thumbnail_id( $post->ID ); } $item->backstretch = wp_get_attachment_image_src( $image_id, 'displayfeaturedimage_backstretch' ); + // set a content variable so backstretch doesn't show if full size image exists in post. + $item->content = ''; // declare this last so that $item->backstretch is set. - if ( ! is_admin() ) { + if ( ! is_admin() && is_singular() ) { $fullsize = wp_get_attachment_image_src( $image_id, 'original' ); $item->content = strpos( $post->post_content, 'src="' . $fullsize[0] ); // reset backstretch image source to fallback if it exists and the featured image is being used in content. - if ( ( ! empty( $item->fallback ) && false !== $item->content ) || in_array( get_post_type(), self::use_fallback_image() ) ) { + if ( ( ! empty( $item->fallback ) && false !== $item->content ) || empty( $post->post_content ) ) { $item->backstretch = wp_get_attachment_image_src( $item->fallback_id, 'displayfeaturedimage_backstretch' ); $item->content = strpos( $post->post_content, 'src="' . $item->backstretch[0] ); } From ffc5530135712bfbd1268ca36e7f08368f2d46bf Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Sat, 8 Nov 2014 10:32:18 -0500 Subject: [PATCH 2/3] readme --- README.md | 4 ++-- readme.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8858f21..238ae65 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Display Featured Image for Genesis -This plugin works within the Genesis Framework, to display your post/page featured images in new and fun ways. It should work with either HTML5 or XHTML themes, but older themes may have a width set on elements which may not allow the full backstretch experience. +This plugin works within the Genesis Framework, to display featured images in new and fun ways. It should work with either HTML5 or XHTML themes, but older themes may have a width set on elements which may not allow the full backstretch experience. ## Description @@ -132,7 +132,7 @@ function rgc_omit_excerpts( $post_types ) { } ``` -_Note:_ unless you check the option to __Move Excerpts/Archive Descriptions__, archive headlines will be styled similarly to the standard single post/page output. If you check this option, the titles and descriptions will move to overlay the leader image. +_Note:_ unless you check the option to __Move Excerpts/Archive Descriptions__, archive headlines will be styled similarly to the standard single post/page output. If you check this option, all titles and descriptions will move to overlay the leader image. ## Credits diff --git a/readme.txt b/readme.txt index 1f10a40..bf84f88 100644 --- a/readme.txt +++ b/readme.txt @@ -9,7 +9,7 @@ Stable tag: 1.4.0 License: GPL-2.0+ License URI: http://www.gnu.org/licenses/gpl-2.0.txt -This plugin works within the Genesis Framework, to display your featured images in beautiful and dynamic ways. +This plugin works within the Genesis Framework, to display featured images in beautiful and dynamic ways. == Description == @@ -83,7 +83,7 @@ Additionally/alternatively, you could set a max-height for the backstretch image .big-leader { - max-height: 700px !important; + max-height: 700px; } = I checked the __Move Excerpts/Archive Descriptions__ option, but don't want excerpts to show on a certain custom post type, even with the featured image. = @@ -98,7 +98,7 @@ There's a filter for that, too. For example, adding this to your functions.php f return $post_types; } -_Note:_ unless you check the option to __Move Excerpts/Archive Descriptions__, archive headlines will be styled similarly to the standard single post/page output. If you check this option, the titles and descriptions will move to overlay the leader image. +_Note:_ unless you check the option to __Move Excerpts/Archive Descriptions__, archive headlines will be styled similarly to the standard single post/page output. If you check this option, all titles and descriptions will move to overlay the leader image. == Screenshots == @@ -149,4 +149,4 @@ New feature: set a default image to be used sitewide! * added the filter for certain post types, and optional filter for other custom post types = 1.0.0 = -* Initial release on Github \ No newline at end of file +* Initial release on Github From 4b1de18a1ced5170e70f9c846a6d5d840dd1b5cd Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Sat, 8 Nov 2014 10:40:36 -0500 Subject: [PATCH 3/3] updated .pot --- languages/display-featured-image-genesis.pot | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/languages/display-featured-image-genesis.pot b/languages/display-featured-image-genesis.pot index 6c490a9..c272d04 100644 --- a/languages/display-featured-image-genesis.pot +++ b/languages/display-featured-image-genesis.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Display Featured Image for Genesis 1.3.0\n" +"Project-Id-Version: Display Featured Image for Genesis 1.4.0\n" "POT-Creation-Date: 2014-09-17 21:11-0500\n" "PO-Revision-Date: 2014-11-05 14:16-0500\n" "Last-Translator: Robin Cornett \n" @@ -18,11 +18,11 @@ msgstr "" "X-Poedit-Language: English\n" "X-Poedit-Country: UNITED STATES\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Poedit-KeywordsList: " -"__;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;_nx_noop:1,2,3c;esc_" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_ex:1,2c;_n:1,2;_nx:1,2,4c;_n_noop:1,2;" +"_nx_noop:1,2,3c;esc_" "attr__;esc_html__;esc_attr_e;esc_html_e;esc_attr_x:1,2c;esc_html_x:1,2c;\n" "X-Poedit-Bookmarks: \n" -"X-Poedit-SearchPath-0: .\n" +"X-Poedit-SearchPath-0: ..\n" "X-Textdomain-Support: yes\n" #: ../includes/class-displayfeaturedimagegenesis-settings.php:26