mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
130 lines
5.6 KiB
Plaintext
130 lines
5.6 KiB
Plaintext
=== Display Featured Image for Genesis ===
|
|
|
|
Contributors: littler.chicken
|
|
Donate link: https://robincornett.com/donate/
|
|
Tags: backstretch, featured image, featured images, genesis, studiopress, post thumbnails
|
|
Requires at least: 3.8
|
|
Tested up to: 4.0
|
|
Stable tag: 1.3.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.
|
|
|
|
== Description ==
|
|
|
|
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:
|
|
|
|
* display the image as a _backstretch_ (screen width) image if the image is wider than your site's Large Media Setting.
|
|
* display the image above your post/page content, centered and up to the width of the content, if your image is larger than your Medium Media Setting, and less than or equal to your Large Media Setting.
|
|
* display _nothing_ if your featured image width is less than or equal to your Medium Media Setting.
|
|
* display a _default featured image_ as a backstretch image if one is uploaded.
|
|
|
|
More words at [my site](http://robincornett.com/plugins/display-featured-image-genesis/).
|
|
|
|
*Note: although this plugin requires the [Genesis Framework by StudioPress](http://studiopress.com/) or child themes, it is not an official plugin for this framework and is neither endorsed nor supported by StudioPress.*
|
|
|
|
== Installation ==
|
|
|
|
1. Upload the entire `display-featured-image-genesis` folder to your `/wp-content/plugins` directory.
|
|
1. Activate the plugin through the 'Plugins' menu in WordPress.
|
|
1. Optionally, visit the Settings > Media page to change the default behavior of the plugin.
|
|
|
|
== Frequently Asked Questions ==
|
|
|
|
= 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:
|
|
|
|
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;
|
|
}
|
|
|
|
It seems that you can also include [conditional tags](http://codex.wordpress.org/Conditional_Tags) in the above, eg `$post_types[] = is_front_page();` to stop the featured image from displaying. This is most helpful if you have set a default featured image in the Customizer.
|
|
|
|
= Can I force my site to use the default image on a post type even if it has its own Featured Image? =
|
|
|
|
Yes! You'll want to add a filter to your theme (functions.php file). Here's an example:
|
|
|
|
add_filter( 'display_featured_image_genesis_use_default', 'rgc_force_default_image' );
|
|
function rgc_force_default_image( $post_types ) {
|
|
$post_types[] = 'attorney';
|
|
|
|
return $post_types;
|
|
}
|
|
|
|
= The backstretch image is a little too tall. =
|
|
|
|
If you do not want the height of the backstretch image to be quite the height of the user's window, you can reduce it by just a hair. Go to Settings > Media and change the 'Height' number from the default of 0. The higher this number is, the shorter your image will be. Feel free to experiment, as no images are harmed by changing this number.
|
|
|
|
Additionally/alternatively, you could set a max-height for the backstretch image area via css:
|
|
|
|
|
|
.big-leader {
|
|
max-height: 700px !important;
|
|
}
|
|
|
|
= 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. =
|
|
|
|
There's a filter for that, too. For example, adding this to your functions.php file would make sure that the excerpt does not show on single posts, or posts from the Staff post type, even if they have an excerpt.
|
|
|
|
add_filter( 'display_featured_image_genesis_omit_excerpt', 'rgc_omit_excerpts' );
|
|
function rgc_omit_excerpts( $post_types ) {
|
|
$post_types[] = 'staff';
|
|
$post_types[] = 'post';
|
|
|
|
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.
|
|
|
|
|
|
== Screenshots ==
|
|
1. Screenshot of a page using the Backstretch Featured Image
|
|
2. Set a Default Featured Image on the Settings > Media page.
|
|
|
|
== Upgrade Notice ==
|
|
= 1.3.0 =
|
|
New feature: Set a Default Featured Image (1.2.0); show archive headlines/descriptions/excerpts with backstretch featured image (1.3.0)
|
|
|
|
== Changelog ==
|
|
|
|
= 1.3.0 =
|
|
* optional taxonomy/author/CPT headline now shows over leader image
|
|
* optional taxonomy/author/CPT description and single post excerpt display optionally over leader image as well
|
|
|
|
= 1.2.2 =
|
|
* default image validation
|
|
|
|
= 1.2.1 =
|
|
* moved default image from Customizer to Media Settings page
|
|
* new filter for forcing default image for any post type
|
|
* common class
|
|
|
|
= 1.2.0 =
|
|
* new feature: default featured image to display if no image is set
|
|
* better method naming/organization
|
|
|
|
= 1.1.3 =
|
|
* output is now properly managed to show only on single posts/pages and home page, not archives
|
|
|
|
= 1.1.2 =
|
|
* proper deactivation if Genesis isn't the active theme.
|
|
|
|
= 1.1.1 =
|
|
* corrected XHTML hooks
|
|
|
|
= 1.1.0 =
|
|
* added a setting in the admin to optionally reduce the height of the backstretch image (eg. due to header height issues)
|
|
* refactoring
|
|
* wp.org release
|
|
|
|
= 1.0.1 =
|
|
* added the filter for certain post types, and optional filter for other custom post types
|
|
|
|
= 1.0.0 =
|
|
* Initial release on Github |