• Resolved SirBiscuits

    (@sirbiscuits)


    Howdy!

    I have installed and configured the plugin and everything is working fine from within WordPress (all my @2x images are being generated perfectly).

    Alas, I am simply unable to get the @2x images to load without enabling debug mode, which of course loads the @2x on every device. When I use debug mode, every device gets the @2x images, when I untick it every device gets the normal size version. The detection to work out whether to server the normal or @2x versions doesn’t appear to be working.

    I am using the HTML Rewrite method as this best suits my needs. Originally I couldn’t get the @2x images to load at all but that’s because I didn’t have wp_head() in my theme. Is there any other common WordPress theme functions required by the plugin?

    I did try using the Twenty Thirteen theme and disabling other plugins I’ve installed, but to no avail. I am using the Advanced Custom Fields plugin to upload the images – and wp_get_attachment_image_src from within the theme to output the images.

    Any suggestions? I feel I’m close – but can’t quite figure out how to finally get this working!

    http://ww.wp.xz.cn/plugins/wp-retina-2x/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Without using the debug-mode, do you see any “retina” script being loaded? However, if you have wp_head() in your theme it should work.

    What’s the URL of your website?

    Thread Starter SirBiscuits

    (@sirbiscuits)

    Thanks for the reply!

    I can see a “/wp-content/plugins/wp-retina-2x/js/retina-images.js?ver=1.4.1” JavaScript file in <head> of my site so that part is working fine.

    I’ve checked and the devicePixelRatio cookie is being set on my desktop (with a value of 1) but is not being set on my phone and tablet. Presumably, the cookie value is vital to what images are shown? I’ve no idea why the cookie isn’t being set on my phone and tablet – it’s a responsive site so the HTML is the same as with the desktop site.

    My site is still in development on my local machine so I can’t share a URL. Could the issue be related to localhost maybe?

    Thread Starter SirBiscuits

    (@sirbiscuits)

    Looks like localhost was the issue – just uploaded a static page to my webserver and the cookie is set for phone/tablet users (I have to refresh the page though before it works – presumably there is no way around that?).

    Plugin Author Jordy Meow

    (@tigroumeow)

    Unfortunately yes, you need to refresh. Luckily all the browsers will get updated soon so that we can all use the srcset method.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘@2x images only load in debug mode’ is closed to new replies.