diff --git a/inc/shortcodes.php b/inc/shortcodes.php index 3a7802a..f6812ab 100644 --- a/inc/shortcodes.php +++ b/inc/shortcodes.php @@ -199,6 +199,17 @@ private function get_image_markup( $feed, $width, $size, $wrapper, $link ) { break; } } + else { + if ( $width <= $image->images->thumbnail->width ) { + $url = $image->images->thumbnail->url; + } + else if ( $width <= $image->images->low_resolution->width ) { + $url = $image->images->low_resolution->url; + } + else { + $url = $image->images->standard_resolution->url; + } + } // Fix https $url = str_replace( 'http://', '//', $url ); @@ -253,4 +264,4 @@ public static function get_instance() { return self::$instance; } -} \ No newline at end of file +}