This plugin works within the Genesis Framework, to display featured images in beautiful and dynamic ways.
This plugin takes a different approach to how we use and display featured images for posts and pages. Instead of simply reusing an image which already exists in the post/page content, the plugin anticipates that you will want to use lovely large images for your featured images, but to do so intelligently. Depending on what you upload, the plugin will:
More words at my site.
Note: although this plugin requires the Genesis Framework by StudioPress or child themes, it is not an official plugin for this framework and is neither endorsed nor supported by StudioPress.
Display Featured Image for Genesis allows you to select a default, or fallback, Featured Image, which will be used if a post/page does not have a Featured Image set, or if the post/page’s Featured Image is too small (smaller than your medium image setting), and on archive and taxonomy pages. You may set the Default Featured Image under Appearance > Display Featured Image Settings.
You may set a Featured Image for each term within a taxonomy (categories, tags, and any taxonomy for custom post types). This image will be used on taxonomy archives, and as a fallback image for posts within that taxonomy if no featured image exists (or if the featured image is too small). If a post is assigned to multiple terms and has no featured image of its own, the most used term which has a featured image assigned will be the one used.
If your site uses Custom Post Types, you can set a Featured Image for each Post Type on the main Display Featured Image for Genesis settings page. If your single post within this type does not have a featured image, the Post Type Featured Image will be used as a fallback.
Now you can add the Featured Image from each post to your RSS feed. This is an optional setting and applied intelligently:
You can check/change your feed settings on your site’s Settings > Reading page.
If you are already inserting your Featured Image into your feed through another function or plugin, you’ll want to remove that before activating this feature; otherwise you will have two copies of the image added to your feed! If you are using Send Images to RSS, don’t worry about it. I’ve made sure these two plugins coexist happily.
Display Featured Image for Genesis has some styling built in but I have intentionally tried to keep it minimal. All styling is for the banner image options, as the large options seem pretty straightforward. Stying for titles are largely inherited from your theme–for example, the title will use the same size and font for your page titles, whether you are using a Featured Image or not. Some styles you can incorporate into your own theme:
.has-leader
applies to any page using a leader/banner image. Applies to the whole page..big-leader
the container which holds the leader/banner image and the post/page Title and excerpt or description..featured-image-overlay
style appended to the post/page title if Move Excerpts option is not selected (default)..excerpt
(for single posts/pages) and .archive-description
(for archives) are styled as a unit. These are the containers for the post/page/archive/taxonomy title and description if the Move Excerpts option is selected..featured
is appended to the large image output directly above the post/page content.display-featured-image-genesis
folder to your /wp-content/plugins
directory.Yes and no. Technically, it does, even older (XHTML) themes. However, depending on other factors such as the individual theme’s styling and layout, the output may be unexpected, and require some tweaking. 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.
As of version 3.1.0, you can choose to display even banner images completely with WordPress’ native responsive images and CSS. No JavaScript required. Just visit the settings page (the Banner Output tab) and check the “Disable JavaScript” option. If you have previously used the banner (backstretch) featured image, you may notice that the output is slightly different, but it should be very close to the same, and easier to override with pure CSS if you need to.
Generally, the banner images will display more or less the same whether you choose to use the JavaScript version or not. Where you may experience a significant difference is if you have the following setup:
.big-leader
element which is significantly different than the screen height (at least sometimes)The scriptless banner image position will ignore the parent container max-height. If you set the Maximum Height in the plugin, the new rule is added to the .big-leader__image
instead of the .big-leader
container. So if your theme is set up this way but you want to switch to the scriptless banner image, you can either enter the max-height number on the plugin settings options, or you can add the same max-height rule to your CSS, but on the .big-leader__image
element in addition to the .big-leader
. The plugin will add the rule to both elements if you use the setting.
Yes. As of version 3.2.0, blocks have been registered for each widget. Add a featured term, author, or post type block anywhere you can add a block.
Alternatively, but not as nice: shortcodes for each widget include:
The parameters/attributes for these mirror the widget options, so you can explore the code (or inspect the widget form) to find the shortcode attributes.
Alternatively, the much easier method entails visiting the settings page (under Appearance) and enabling the shortcode buttons for the post editor. With the shortcode buttons enabled, you can use the familiar widget form to build the shortcode and add it anywhere you like.
If these images were saved to your database prior to version 2.2.0 of this plugin and you’ve never updated the plugin settings since then, these images may have effectively disappeared in version 3.0.0. To fix this, visit the plugin settings page, reselect your default/post type image(s), and save.
Prior to version 2.2.0 of the plugin, these images were saved to the database as URL strings, rather than as ID numbers, which was hugely inefficient. This was changed in version 2.2.0, with backwards compatible helper functions to ease the transition, but the helper functions are no longer used as of version 3.0.0.
Check the settings page before digging into filters. As of version 3.0.0, most questions/support requests have been implemented as options on the settings pages, including:
Additionally, some of these can be overridden on any individual post, page, or content type, which can be set to use the default image size, not show a featured image at all, or force a large/banner image for that post only.
There are several filters built into Display Featured Image for Genesis, to give developers more control over the output. Several of them are very similar, and are applied in a specific order, so an earlier filter will take precedence over a later one.
Available filters include, but are not limited to:
display_featured_image_genesis_skipped_posttypes
: select post type(s) which will not have the featured image effect applied (Note: this filter still totally works, but there is now a setting to handle this. It’s on the Content Types tab.)display_featured_image_genesis_use_default
: force post type(s) to use your sitewide default image (set on the main plugin settings page) for the featured image effect, regardless of what is set as the individual post’s featured imagedisplayfeaturedimagegenesis_use_post_type_image
: force post type(s) to use the image assigned as the custom post type featured image (if one is set), regardless of what is set as the individual post’s featured imagedisplay_featured_image_genesis_use_taxonomy
: force post type(s) to use a taxonomy term’s image (if one is set) for the featured image effect, regardless of what is set as the individual post’s featured imagedisplay_featured_image_genesis_use_large_image
: force post type(s) to output the featured image as a large image above the post content, and to not use the banner effect at alldisplay_featured_image_genesis_omit_excerpt
: force post type(s) to not move the excerpt to overlay the featured image, even if the “Move Excerpts/Archive Descriptions” setting is selectedThese filters all work the same way, so using any one in your theme will all follow the same pattern. For example, to prevent the featured image effect on the listing
or staff
post types, you would add the following to your theme’s functions.php file:
add_filter( 'display_featured_image_genesis_skipped_posttypes', 'rgc_skip_post_types' ); function rgc_skip_post_types( $post_types ) { $post_types[] = 'listing'; $post_types[] = 'staff'; return $post_types; }
To force a post type to use the sitewide Featured Image, use this filter instead:
add_filter( 'display_featured_image_genesis_use_default', 'rgc_force_default_image' ); function rgc_force_default_image( $post_types ) { $post_types[] = 'post'; return $post_types; }
Alternatively, you can also set a specific post type to use the taxonomy featured image, if one exists, even if the post type has its own Featured Image:
add_filter( 'display_featured_image_genesis_use_taxonomy', 'rgc_use_tax_image' ); function rgc_use_tax_image( $post_types ) { $post_types[] = 'post'; return $post_types; }
If a post has no featured image of its own, and is assigned to multiple taxonomy terms which do have images assigned, the plugin will opt to use the featured image from the most popular term (the one with the most posts already).
If you’re needing to have a little more control than just specifying which post type to skip, and maybe want to use WordPress conditional statements, you’ll want a different filter. This example disables the plugin on WooCommerce term archives:
add_filter( 'displayfeaturedimagegenesis_disable', 'prefix_skip_woo_terms' ); function prefix_skip_woo_terms( $disable ) { if ( 'product' === get_post_type() && is_tax() ) { return true; } return $disable; }
Please see the plugin settings page. If you were using the old method (display_featured_image_genesis_add_archive_thumbnails
) to do this, the plugin will attempt to remove that from your output, but you may want to double check your archives.
This will follow the settings you choose in the Genesis Theme Settings.
If you do not want the height of the banner image to be quite the height of the user’s browser window, which is the standard, you can reduce it by just a hair. Go to Appearance > Display Featured Image Settings and change the ‘Height’ number from the default of 0. The higher this number is, the shorter the window will be calculated to be. Feel free to experiment, as no images are harmed by changing this number.
Note:Display Featured Image for Genesis determines the size of your banner image based on the size of the user’s browser window. Changing the “Height/Pixels to Remove” setting tells the plugin to subtract that number of pixels from the measured height of the user’s window, regardless of the size of that window, which is partly why you cannot set this to more than 400.
If you need to control the size of the banner Featured Image output with more attention to the user’s screen size, you will want to consider a CSS approach instead. You can use the plugin’s Maximum Height setting, which will affect all screen sizes, or add something like this to your theme’s stylesheet, or the additional CSS panel in the Customizer:
.big-leader, .big-leader__image { max-height: 700px; } @media only screen and (max-width: 800px) { .big-leader, .big-leader__image { max-height: 300px; } }
Note: if your theme has CSS like this in it already, and you change the Maximum Height setting, it will (most likely) override your theme’s styling, due to the order in which stylesheets load.
As of version 3.0.0, you can change the hook/location of the large featured image without code by going to Appearance > Display Featured Image for Genesis, and then the Advanced tab.
There is a filter for this, too. By default, the large (as opposed to banner) image is added before the Genesis loop, which places it above your post or page title. You can add this filter to your theme’s functions.php file to move the image below your post/page title:
add_filter( 'display_featured_image_genesis_move_large_image', 'prefix_move_image' ); function prefix_move_image( $hook ) { return 'genesis_entry_header'; }
Note: because the entry header applies to all posts on a page, on archive pages, this filter will be overridden with the default genesis_before_loop
. To move the large image on an archive page, do not use a hook related to a single post.
Similar hooks:
display_featured_image_genesis_move_large_image_priority
: change the priority of the large featured image outputdisplay_featured_image_move_backstretch_image
: change the hook of the banner featured image outputdisplay_featured_image_move_backstretch_image_priority
: change the priority of the banner featured image output