mirror of
https://github.com/10h30/display-featured-image-genesis.git
synced 2026-06-05 15:08:20 +09:00
different metadata function to play nice with Photon
This commit is contained in:
@@ -39,7 +39,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
$item = Display_Featured_Image_Genesis_Common::get_image_variables();
|
||||
|
||||
// if there is no backstretch image set, or it is too small, die
|
||||
if ( empty( $item->backstretch ) || $item->backstretch[1] <= $item->medium ) {
|
||||
if ( empty( $item->backstretch ) || $item->width <= $item->medium ) {
|
||||
return;
|
||||
}
|
||||
// if the featured image is not part of the content, or we're not on a singular page, carry on
|
||||
@@ -48,7 +48,7 @@ class Display_Featured_Image_Genesis_Output {
|
||||
wp_enqueue_style( 'displayfeaturedimage-style', plugins_url( 'includes/css/display-featured-image-genesis.css', dirname( __FILE__ ) ), array(), $version );
|
||||
|
||||
//check if the image is large enough for backstretch
|
||||
if ( $item->backstretch[1] > $item->large ) {
|
||||
if ( $item->width > $item->large ) {
|
||||
wp_enqueue_script( 'displayfeaturedimage-backstretch', plugins_url( '/includes/js/backstretch.js', dirname( __FILE__ ) ), array( 'jquery' ), $version, true );
|
||||
wp_enqueue_script( 'displayfeaturedimage-backstretch-set', plugins_url( '/includes/js/backstretch-set.js', dirname( __FILE__ ) ), array( 'jquery', 'displayfeaturedimage-backstretch' ), $version, true );
|
||||
|
||||
@@ -78,15 +78,15 @@ class Display_Featured_Image_Genesis_Output {
|
||||
|
||||
$item = Display_Featured_Image_Genesis_Common::get_image_variables();
|
||||
|
||||
if ( empty( $item->backstretch ) || $item->backstretch[1] <= $item->medium ) {
|
||||
if ( empty( $item->backstretch ) || $item->width <= $item->medium ) {
|
||||
return $classes;
|
||||
}
|
||||
|
||||
if ( false === $item->content || ! is_singular() ) {
|
||||
if ( $item->backstretch[1] > $item->large ) {
|
||||
if ( $item->width > $item->large ) {
|
||||
$classes[] = 'has-leader';
|
||||
}
|
||||
elseif ( $item->backstretch[1] <= $item->large ) {
|
||||
elseif ( $item->width <= $item->large ) {
|
||||
$classes[] = 'large-featured';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user