• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

My Monkey Do

A Log of Coding Solutions

  • Home
  • Web Hosts
  • Tools
  • About

Disable Responsive Images in WordPress

January 29, 2016 by Webhead

In WordPress 4.4 images are displayed with the srcset attribute.  This attribute allows the browser to select alternative images for best viewing.  Sometimes though this may not be wanted as the image being displayed is the only image you want to show for all users.

To not have any srcset images, use the following:

add_filter( ‘wp_calculate_image_srcset_meta’, ‘__return_null’ );

For other filters new to WordPress 4.4, you can visit the blog post:

Responsive Images in WordPress 4.4

 

One user had a problem with the images in the srcset not having the https protocol and causing security warnings.  This stack overflow post resolves that:

http://wordpress.stackexchange.com/questions/211375/how-do-i-disable-responsive-images-in-wp-4-4

 

Filed Under: Coding Tagged With: wordpress

Primary Sidebar

Topics

apache apple block editor chrome cms css debug eCommerce embed firebug firefox git gmail goDaddy google hosting htaccess html html 5 IE crap image iPad iPhone javascript jquery linux localization mac os x ms sql mysql open source optimize php php 5.3 responsive rest api seo svg tinymce woocommerce wordpress wpengine xss yii youtube




Categories

  • Coding
  • Off the Shelf
  • Plugins
  • Random Thoughts
  • Server Stuff
  • Tools