mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-07-18 14:03:20 +09:00
Add medium_large image to possible backstretch image sources
This commit is contained in:
@@ -114,12 +114,20 @@ class Display_Featured_Image_Genesis_Output {
|
||||
'fade' => 750,
|
||||
) );
|
||||
|
||||
$image_id = Display_Featured_Image_Genesis_Common::set_image_id();
|
||||
$large = wp_get_attachment_image_src( $image_id, 'large' );
|
||||
$output = array(
|
||||
'src' => esc_url( $this->item->backstretch[0] ),
|
||||
'largesrc' => esc_url( $large[0] ),
|
||||
'width' => $large[1],
|
||||
$image_id = Display_Featured_Image_Genesis_Common::set_image_id();
|
||||
$large = wp_get_attachment_image_src( $image_id, 'large' );
|
||||
$medium_large = wp_get_attachment_image_src( $image_id, 'medium_large' );
|
||||
$output = array(
|
||||
'source' => array(
|
||||
'backstretch' => esc_url( $this->item->backstretch[0] ),
|
||||
'large' => esc_url( $large[0] ),
|
||||
'medium_large' => esc_url( $medium_large[0] ),
|
||||
),
|
||||
'width' => array(
|
||||
'backstretch' => $this->item->backstretch[1],
|
||||
'large' => $large[1],
|
||||
'medium_large' => $medium_large[1],
|
||||
),
|
||||
'height' => (int) $this->displaysetting['less_header'],
|
||||
'centeredX' => (int) (bool) $backstretch_vars['centeredX'],
|
||||
'centeredY' => (int) (bool) $backstretch_vars['centeredY'],
|
||||
|
||||
@@ -13,13 +13,20 @@
|
||||
|
||||
function _backstretchHandler() {
|
||||
|
||||
var source = window.innerWidth <= plugin.params.width ? plugin.params.largesrc : plugin.params.src,
|
||||
var source = plugin.params.source.backstretch,
|
||||
$el = $( '.big-leader' );
|
||||
|
||||
if (typeof $el === 'undefined') {
|
||||
if ( typeof $el === 'undefined' ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( window.innerWidth <= plugin.params.width.large ) {
|
||||
source = plugin.params.source.large;
|
||||
}
|
||||
if ( window.innerWidth <= plugin.params.width.medium_large ) {
|
||||
source = plugin.params.source.medium_large;
|
||||
}
|
||||
|
||||
$el.css( {
|
||||
height: ( $(window).height() ) - ( [ plugin.params.height ] ) + 'px'
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user