diff --git a/README.md b/README.md index e42724c..661821f 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,10 @@ _Set a Default Featured Image on the Appearance > Display Featured Image for Gen Display Featured Image for Genesis has its own settings page, under the main Appearance menu. +### Does this work with any Genesis child theme? + +Yes and no. Technically, it does, even older (XHTML) themes. However, depending on other factors such as the individual theme's styling and layout. Not recommended for themes such as Sixteen Nine Pro, or The 411 Pro due to layout, and not for Ambiance Pro or Minimum Pro without changing some theme functionality. + ### How do I stop the featured image action from showing on my custom post types? You'll want to add a filter to your theme (functions.php file). Here's an example: diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index 0824eb6..050a801 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -21,18 +21,19 @@ class Display_Featured_Image_Genesis_Common { // variables internal to this function $frontpage = get_option( 'show_on_front' ); // either 'posts' or 'page' $postspage = get_option( 'page_for_posts' ); - $move_excerpts = get_option( 'displayfeaturedimage_excerpts' ); + $displaysetting = get_option( 'displayfeaturedimagegenesis' ); + $move_excerpts = $displaysetting['move_excerpts']; $postspage_image = get_post_thumbnail_id( $postspage ); if ( is_singular() ) { $post_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'displayfeaturedimage_backstretch' ); } // variables used outside this function - $item->fallback = esc_attr( get_option( 'displayfeaturedimage_default' ) ); + $item->fallback = esc_attr( $displaysetting['default'] ); $item->fallback_id = self::get_image_id( $item->fallback ); $item->large = absint( get_option( 'large_size_w' ) ); $item->medium = absint( get_option( 'medium_size_w' ) ); - $item->reduce = absint( get_option( 'displayfeaturedimage_less_header', 0 ) ); + $item->reduce = absint( $displaysetting['less_header'] ); // Set Featured Image Source $item->original = wp_get_attachment_image_src( $item->fallback_id, 'displayfeaturedimage_backstretch' ); @@ -127,7 +128,8 @@ class Display_Featured_Image_Genesis_Common { */ public static function get_skipped_posttypes() { - $skip = get_option( 'displayfeaturedimage_exclude_front' ); + $displaysetting = get_option( 'displayfeaturedimagegenesis' ); + $skip = $displaysetting['exclude_front']; $post_types = array(); $post_types[] = 'attachment'; diff --git a/includes/class-displayfeaturedimagegenesis-output.php b/includes/class-displayfeaturedimagegenesis-output.php index 598fb5a..4bf4777 100644 --- a/includes/class-displayfeaturedimagegenesis-output.php +++ b/includes/class-displayfeaturedimagegenesis-output.php @@ -15,7 +15,8 @@ class Display_Featured_Image_Genesis_Output { * @since 1.1.3 */ public function manage_output() { - $fallback = get_option( 'displayfeaturedimage_default' ); + $displaysetting = get_option( 'displayfeaturedimagegenesis' ); + $fallback = $displaysetting['default']; if ( ( empty( $fallback ) && ! is_home() && ! is_singular() ) || ( in_array( get_post_type(), Display_Featured_Image_Genesis_Common::get_skipped_posttypes() ) ) ) { return; } @@ -102,7 +103,8 @@ class Display_Featured_Image_Genesis_Output { echo '