0

I have updated the magefan extension and the images stop showing on blog lists page. When I click on the read more button and go to the post, the image is there, but the small thumbnail image in blog list mage is missing.

The inspector is giving me:

<img class="img-responsive" src=(unknown) alt="Image alt">

When I print the $img it does not returns me anything:

$img = $_helper->init($_post->getImage())->resize($_width,$_height);

In my error log i have error like this:

[Fri Aug 04 11:03:03.564586 2017] [:error] [pid 6922] [client 
127.0.0.1:58264] PHP Fatal error:  Allowed memory size of 805306368 
bytes exhausted (tried to allocate 400572416 bytes) in 
/home/sasa/www/shopifit/app/design/frontend/Emthemes/
everything/default/Magefan_Blog/templates/post/list/item.phtml on line 
25, referer: http://shopifit/
[Fri Aug 04 11:03:03.564784 2017] [:error] [pid 6922] [client 
127.0.0.1:58264] PHP Fatal error:  Allowed memory size of 805306368 
bytes exhausted (tried to allocate 400560128 bytes) in Unknown on line 
0, referer: http://shopifit/

I tried php bin/magento setup:static-content:deploy and give all project sudo chmod -R 777 but nothing seems to work. If anyone have any idea please let me know.

0

I think, the problem is in resizing.

The right way to resize images in Magefan Blog *.phtml templates is described here https://github.com/magefan/module-blog/wiki/How-to-resize-post-image-in-Magefan-Blog-extension-for-Magento-2

Pay attention, there are two similar by name methods:

$_post->getFeaturedImage();   // returns the full image URL
$_post->getFeaturedImg();     // returns relative image path, based on Magento media folder
For correct resizing we need to use the second one.

Hope, it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.