• I recently figured out a huge problem for images on my site.

    I recently disabled all the WordPress image sizes (thumbnail, large, medium-large) except for the medium size. Now I only have medium and my original image.

    WordPress shows responsive images. So, WP shows the large or medium-large image on mobile even though I get the_post_thumbnail(‘medium);. It is even the same for size images inside the post-editor. But currently, WP shows my original big image for responsiveness as I only have the original image beside the medium 300px image.

    It’s obvious that nobody wants an image size to increase after selecting a smaller version. WP behaves opposite in that way. If you select medium, it outputs the medium-large or large for all mobile or tablet screens.

    Adjusting higher sizes to lower is one of the best features, but showing the higher image even after selecting small is the problem.

    I now want to disable responsiveness when calling the medium size image.
    Currently, I’m not sure if I should disable srcset sitewide.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The theme determines how the images are applied. Depending on the theme you have this can vary greatly. Not sure what srcset is a class or what?

    Anyway images sizes are usually set in the functions.php file with a function called add_image_size. The images are generated when you upload them. If you change the size in the functions.php old images will not be regenerated nor will images be deleted that already exist.

    You can find plugins that will generate new images for the ones that already exist such as Regenerate Thumbnails. However, your problem could also be created from CSS code. If you are using cover as your your image size the browser will adjust the image properties to cover the area you are looking at.

    Without knowing what theme you are using it would be difficult to provide an answer.

    Thread Starter Bikramjit

    (@bikram00)

    Look Here

    I have looked everywhere for the solution: google, WordPress forum, StackOverflow. But I don’t understand any code. So, I have not understood a single thing.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Which theme are you using?

    Thread Starter Bikramjit

    (@bikram00)

    Ribbon

    I have removed the extra image sizes “add_image_size” by the theme. I have also disabled
    medium_large size, thumbnail and large image are 0x0 on my setting.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Where exactly on your website are you seeing the issue? It’s important to be explicit at this stage.

    Thread Starter Bikramjit

    (@bikram00)

    I use the_post_thumbnail('medium');

    1. https://sitejury.com/review/ysense/
    This post got a new image that have only two size original and 300px

    2. https://sitejury.com/review/investorclix/
    Now, this post has an old image before I disabled the default WP image sizes. So, I have all images thumbnail, medium, backend-medium-large and Large.

    Everything is fine in PC, the image is medium. But the problem is when I see the image on mobile. It gets increased to the upper size for responsiveness. No-1 goes to original and No-2 goes to hidden-medium-large.

    I actually, lived for months with the issue, I recently figured it out when I saw one of my friends checking my site on his mobile.
    No one wants an image to get increased in size after selecting a small image.

    Sizes are even visible on Google Pagespeed.

    Thread Starter Bikramjit

    (@bikram00)

    Hello. You know what could be my problem and how to solve it? @anevins

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I had time when I posted, now I don’t have time.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Asking people in the generic troubleshooting forum to learn the specifics of your theme to resolve the issue isn’t feasible, you need to ask in your theme’s support forum: https://www.ads-software.com/support/theme/ribbon-lite/

    If they don’t do support then consider switching to an actively supported theme.

    Thread Starter Bikramjit

    (@bikram00)

    Okay. Anyway, The problem is not theme related. It is the core image feature.

    It’s about WordPress responsiveness. I needed to change the core features for that specific thumbnail. I know it’s possible, but I don’t know-how. I have checked WP sites, and they behave that way. and I have found big sites that are utilizing the feature I’m talking about.

    Let me look at other forums, If I can find somebody to help me.

    Thread Starter Bikramjit

    (@bikram00)

    I have figured a way to adjust around the issue.

    I have disabled the default-core image sizes to save my hosting space. Because 300px is already responsive. But now I will have to live with the unwanted extra sizes. It’s a very big issue for me.

      I will have to hard-crop an extra image size for the thumbnail to get the image regardless of screen size.
      re-enable the hidden-medium-large image size.
Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘How Get rid of srcset on a image size and force the size on all screen?’ is closed to new replies.