diff --git a/view/frontend/templates/addthis-js.phtml b/view/frontend/templates/addthis-js.phtml index 0be7b20e..b1c393f2 100644 --- a/view/frontend/templates/addthis-js.phtml +++ b/view/frontend/templates/addthis-js.phtml @@ -8,12 +8,12 @@ ?> helper(\Magefan\Blog\Helper\Image::class); init($featuredImage)->resize($width, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; diff --git a/view/frontend/templates/post/list/item.phtml b/view/frontend/templates/post/list/item.phtml index c44c72d5..2359740b 100644 --- a/view/frontend/templates/post/list/item.phtml +++ b/view/frontend/templates/post/list/item.phtml @@ -16,7 +16,11 @@ getPost(); $_postUrl = $block->escapeUrl($_post->getPostUrl()); +$_postImage = $_post->getOgImage()? $_post->getOgImage() : $_post->getFeaturedImage(); $_postName = $block->escapeHtml($_post->getTitle()); + +$imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class); +$imageWidth = (int)$block->getFeaturedImageWidth() ?: 722; ?>
= $block->escapeHtml($block->getTitle()) ?>
@@ -34,12 +37,17 @@ getFeaturedListImage() ?: $_post->getFeaturedImage(); ?> init($featuredImage)->resize($imageWidth, null, false); + $widthAndHeight = $imageHelper->getWidthAndHeigth(); + $featuredImgAlt = $_post->getData('featured_list_img_alt') ?: $_post->getData('featured_img_alt'); if (!$featuredImgAlt) { $featuredImgAlt = $_postName; } ?> -