最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

templates - Why is wordpress searching for @2x images?

matteradmin6PV0评论

I've created some images for my site with the following path:

/wp-content/themes/my-theme/images/my-image.png

I edited my sites HTML to include this image (and other's like it). Now in my console I have a whole bunch of error messages:

Failed to load resource: the server responded with a status of 404 (Not Found) -

/wp-content/themes/my-theme/assets/images/[email protected] 

I looked up @2x and I found that it has to do with different pixel density images. But why is it even trying to find this image? I didn't tell it to. Is this something wordpress does automatically? Do I have to create a @2x image for every image I add to my site? And why is it searching the assets folder?

I've created some images for my site with the following path:

/wp-content/themes/my-theme/images/my-image.png

I edited my sites HTML to include this image (and other's like it). Now in my console I have a whole bunch of error messages:

Failed to load resource: the server responded with a status of 404 (Not Found) -

/wp-content/themes/my-theme/assets/images/[email protected] 

I looked up @2x and I found that it has to do with different pixel density images. But why is it even trying to find this image? I didn't tell it to. Is this something wordpress does automatically? Do I have to create a @2x image for every image I add to my site? And why is it searching the assets folder?

Share Improve this question edited Jul 6, 2017 at 19:12 Matthew Sirkin asked Jul 6, 2017 at 16:05 Matthew SirkinMatthew Sirkin 932 silver badges9 bronze badges 2
  • Disable your plugins, switch to a default theme, empty all caches and there you'll see the answer. The answer is Nothing of asked. – Max Yudin Commented Jul 6, 2017 at 16:26
  • @MaxYudin I dont have any plugins installed – Matthew Sirkin Commented Jul 6, 2017 at 17:25
Add a comment  | 

1 Answer 1

Reset to default 2

Despite having no plugins installed through wordpress, I did have retina.min.js being enqueued in my functions.php file from the template I downloaded.

Retina.min.js (source: http://imulus.github.io/retinajs/) looks for high resolution versions (denoted with suffix @2x right before the extension) of each image in your site and attempts to replace them if any are found. Since I did not plan on using this feature for the time being, I commented it out of my functions.php file and I now have a clean console.

Post a comment

comment list (0)

  1. No comments so far