By Bas Tolenaar on Friday, 15 March 2019
Posted in General
Replies 1
Likes 0
Views 501
Votes 0
Hi,

On our website we use the large image variant for our blog posts. (Perfect for desktops) It is scaled accordingly to the device size. But is there also a possibility to display the small image variant for our blog posts on mobile devices? So we are not loading a large image with the 1200 x 726 px dimensions on mobile devices? So the pagespeed will increase.
Or do we have to this hardcoded with adding two images (1 small, 1 large) and with css display none.

https://uwassistent.nl/blogs/zzper-worden-vijf-dingen-waar-je-op-moet-letten

Kind regards,

Geert
I think the best way is customise the PHP code from this file JoomlaFolder/components/com_easyblog/themes/wireframe/blogs/entry/post.cover.php , this is the file render that post cover on the blog entry page.

You can use this following function code to determine whether this user currently view on the mobile device or not.


$isMobile = EB::responsive()->isMobile();


If this variable $isMobile return you 'true' mean this user view this blog entry page on mobile device, so you can render thumbnail image size on mobile device.

For example :

if ($isMobile) {
echo $post->getImage('thumbnail', true, false, false);
} else {
echo $post->getImage('large', true, false, false);
}


By the way, it looks like your subscription has expired and in order for you to continue requesting for support, you will need an active subscription. If you have already renewed, please let us know so that we can correct this for your account.
·
Friday, 15 March 2019 17:19
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post