• Hello, as you may already know, wordpress version 4.4 makes your images responsive.
    But i really dont want that, is there a way how can i disable this feature?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • why you don’t want the responsive images WordPress automatically creates several sizes of each image uploaded to the media library. By including the available sizes of an image into a srcset attribute, browsers can now choose to download the most appropriate size and ignore the others—potentially saving bandwidth and speeding up page load times in the process. there is not extra work ob the user side but a positive impact on your performance.

    To modify the default srcset and sizes attributes, you should use the wp_calculate_image_srcset and wp_calculate_image_sizes filters, respectively.

    Overriding the srcset or sizes attributes for images not embedded in post content (e.g. post thumbnails, galleries, etc.), can be accomplished using the wp_get_attachment_image_attributes filter, similar to how other image attributes are modified.

    Additionally, you can create your own custom markup patterns by using wp_get_attachment_image_srcset() directly in your templates.

    at the end also your theme should call the images with the responsive functionality like:

    <?php
    $img_src = wp_get_attachment_image_url( $attachment_id, 'medium' );
    $img_srcset = wp_get_attachment_image_srcset( $attachment_id, 'medium' );
    ?>

    Thread Starter dany547

    (@dany547)

    hello, thenks for the replay. Here is the article as an example: https://geekchronicles.ro/5-cadouri-interesante-de-craciun/ . The images are from an external source, and they are streached above the limit.

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    I don’t think that’s related to WordPress 4.4 Responsive images. It’s actually a style that’s been added to your images giving them a 100% width:

    img {
        width: 100%;
        height: auto;
    }

    You can try to deactivate your plugins if you don’t know where that’s coming from. If none are responsible then it sounds like an issue with your theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WORDPRESS 4.4 Responsive images’ is closed to new replies.