LoginSignup
3
4

More than 5 years have passed since last update.

Wordpressでimgタグにsrcsetとなるのを無効にする

Last updated at Posted at 2016-07-14

Wordpress4.4からレスポンシブイメージというのが実装された。
imgタグにsrcsetというのが出るようだ。

(WP Offload S3 Liteというプラグインを途中から導入したために過去分の画像の表示が上手くいかなかったため・・・)

レスポンシブイメージの機能を無効化の方法は、

functions.phpに1行追加。

functions.php
add_filter( 'wp_calculate_image_srcset', '__return_false' );
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4