kylereicks / picturefill.js.wp

A WordPress plugin to use Picturefill.js for image loading.
106 stars 10 forks source link

plugin only working on localhost:8888 #52

Open nin808 opened 9 years ago

nin808 commented 9 years ago

First let me say thanks for making a great plugin. I've got everything set up and working just how I want it with custom sizes and srcsets, even working with the ACF plugin. But I'm having one major problem: the plugin is only loading in an image's sizes and srcset when I have my WordPress URL set to localhost:8888.

In my template, since I'm calling an image that is set up using ACF, I have the following code:

http://pastebin.com/GY8Bkbhc

When the Wordpress URL is set to localhost:8888, the following code is output by the plugin:

http://pastebin.com/8Mf8sp7R

As I resize my browser window in Safari, the src attribute updates with the most appropriate image so I know it's working. In Chrome it includes the full srcset attribute, and by checking the resources loaded I can see it also loading in only the correct image.

However, I'm using MAMP and in order to share the site across my LAN, I need to update the URL to my IP (192.168.0.6:8888). When I do this, everything works fine and the site loads in all of the images, but instead of having a srcset and sizes attribute, it only has the src fallback, title, and class attributes. The output looks like:

http://pastebin.com/4DMF2s6N

So I can see the URL is updating to the correct address, but it's not loading in any sizes or srcset and only loading a single image.

I've deactivated and reactivated the plugin to clear it's cache thinking that could be the issue, but still it does not work. If I set the WordPress URL back to localhost:8888, then everything works fine again.

Any thoughts?

nin808 commented 9 years ago

My apologies for the multiple updates to my issue. GitHub noob here and I was having trouble getting my gists working.

tychay commented 9 years ago

Most likely this is the culprit: https://github.com/kylereicks/picturefill.js.wp/issues/58