From e28c060729b0cfc151a81577c16b59f5eb07496f Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Thu, 30 Apr 2015 09:58:46 -0400 Subject: [PATCH] update readme (fix archive thumbnail function example) --- README.md | 8 ++++++-- readme.txt | 10 +++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 58854e1..3084dde 100644 --- a/README.md +++ b/README.md @@ -186,8 +186,12 @@ _Note:_ because the entry header applies to all posts on a page, such as a blog Yes! A helper function exists for this, but only runs if you add it. You can easily do this by adding the following to your theme's functions.php file: ```php -if ( class_exists( 'Display_Featured_Image_Genesis' ) ) { - add_action( 'genesis_entry_content', 'display_featured_image_genesis_add_archive_thumbnails', 5 ); +add_action( 'genesis_before_entry', 'rgc_add_archive_thumbnails' ); +function rgc_add_archive_thumbnails() { + if ( class_exists( 'Display_Featured_Image_Genesis' ) ) { + add_action( 'genesis_entry_content', 'display_featured_image_genesis_add_archive_thumbnails', 5 ); // HTML5 themes + add_action( 'genesis_post_content', 'display_featured_image_genesis_add_archive_thumbnails', 5 ); // XHTML themes + } } ``` diff --git a/readme.txt b/readme.txt index d7c7be2..1a1e279 100644 --- a/readme.txt +++ b/readme.txt @@ -145,8 +145,12 @@ _Note:_ because the entry header applies to all posts on a page, such as a blog Yes! A helper function exists for this, but only runs if you add it. You can easily do this by adding the following to your theme's functions.php file: - if ( class_exists( 'Display_Featured_Image_Genesis' ) ) { - add_action( 'genesis_entry_content', 'display_featured_image_genesis_add_archive_thumbnails', 5 ); + add_action( 'genesis_before_entry', 'rgc_add_archive_thumbnails' ); + function rgc_add_archive_thumbnails() { + if ( class_exists( 'Display_Featured_Image_Genesis' ) ) { + add_action( 'genesis_entry_content', 'display_featured_image_genesis_add_archive_thumbnails', 5 ); // HTML5 themes + add_action( 'genesis_post_content', 'display_featured_image_genesis_add_archive_thumbnails', 5 ); // XHTML themes + } } This will follow the settings you choose in the Genesis Theme Settings. @@ -158,7 +162,7 @@ This will follow the settings you choose in the Genesis Theme Settings. == Upgrade Notice == = 2.2.0 = -Changed how default, term, and post type featured images are stored in the database. +Changed how default, term, and post type featured images are stored in the database (better!). == Changelog ==