Featured Images do not Work. HELP!
-
Hi. I am having a big issue trying to get responsive images to work correctly from desktop to mobile.
My media settings are:
thumbnail: 150×150
medium: 250×1024
mobile: 350×1024
large: 700×4096The css for ‘get_post_thumbnail’ shows as ‘medium’ for featured images which looks great on a desktop but looks a bit blurry on a mobile.
When I change it from ‘medium’ to ‘mobile’ it looks great on the mobile but not on the desktop.
Here is the code from my ‘index-masonry’ page:
————————————————————————
$is_gallery = count($images) > 1;$imgsrc = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), ‘medium’);
if ($imgsrc[0] == ”) {
$imgsrc[0] = get_template_directory_uri() . ‘/img/blank.gif’;
$imgsrc[1] = get_option(‘medium_size_w’);
$imgsrc[2] = get_option(‘medium_size_w’);
} else if ($imgsrc[1] <= 1 && $imgsrc[2] <= 1){
$thumbid = get_post_thumbnail_id($post->ID);
$size = getimagesize($imgsrc[0]);
$imgsrc[1] = $size[0];
$imgsrc[2] = $size[1];
}
———————————————————————I have trying to fix this for days and everything I try is not working. Could someone take a look and guide me in the right place.
I have tried setting ‘img’ as well as ‘featured-thumb’ via css to max-width: 100% which doesn’t solve the issue either as it goes outside of it’s container.
You can see what I mean when you look at the desktop and mobile version of my site. Any help or guidance would be greatly appreciated.
Thank you.
The page I need help with: [log in to see the link]
The topic ‘Featured Images do not Work. HELP!’ is closed to new replies.




