- getFeaturedListImage() ?: $_post->getFeaturedImage(); ?>
+ getFeaturedListImg() ?: $_post->getFeaturedImg(); ?>
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;
@@ -63,7 +69,8 @@ $_postName = $block->escapeHtml($_post->getTitle());
diff --git a/view/frontend/templates/post/view-modern.phtml b/view/frontend/templates/post/view-modern.phtml
index bee8593e..ecb85c4b 100644
--- a/view/frontend/templates/post/view-modern.phtml
+++ b/view/frontend/templates/post/view-modern.phtml
@@ -14,9 +14,13 @@
*/
?>
getPost();
- $_postUrl = $_post->getPostUrl();
- $_postName = $block->escapeHtml($_post->getTitle(), null);
+$_post = $block->getPost();
+$_postUrl = $_post->getPostUrl();
+$_postImage = $_post->getFeaturedImg();
+$_postName = $block->escapeHtml($_post->getTitle(), null);
+
+$imageHelper = $this->helper(\Magefan\Blog\Helper\Image::class);
+$imageWidth = (int)$block->getFeaturedImageWidth() ?: 722;
?>
= $block->getStyleViewModel()->getStyle('Magefan_Blog::css/bootstrap-4.4.1-custom-min.css') ?>
@@ -27,13 +31,13 @@
getCategoriesCount()) { ?>
@@ -51,8 +55,8 @@
getRelatedCoauthors();
- $coAuthorsCount = count($coAuthors);
+ $coAuthors = $_post->getRelatedCoauthors();
+ $coAuthorsCount = count($coAuthors);
?>
= $block->escapeHtml(__('and')) ?>
@@ -106,15 +110,18 @@
- getParentCategories() as $ct) { ?>
-
- = $block->escapeHtml($ct->getTitle()) ?>
-
-
-
+ getParentCategories() as $ct) { ?>
+
+ = $block->escapeHtml($ct->getTitle()) ?>
+
+
+
- getFeaturedImage()) { ?>
+ getFeaturedImg()) { ?>
getData('featured_img_alt');
- if (!$featuredImgAlt) {
- $featuredImgAlt = $_postName;
- }
+ $featuredImage = $imageHelper->init($featuredImage)->resize($imageWidth, null, false);
+ $widthAndHeight = $imageHelper->getWidthAndHeigth();
+ $featuredImgAlt = $_post->getData('featured_img_alt');
+ if (!$featuredImgAlt) {
+ $featuredImgAlt = $_postName;
+ }
?>
-
alt="= $block->escapeHtml($featuredImgAlt) ?>" />
@@ -146,20 +153,20 @@
displayAddThisToolbox()) : ?>
-
-
-
= $block->escapeHtml($block->getTitle()) ?>
@@ -31,15 +34,20 @@