- This topic has 12 replies, 3 voices, and was last updated 5 years, 9 months ago by
Tom.
-
AuthorPosts
-
December 5, 2017 at 3:07 pm #442612
Zach
After upgrading to GP 2.0 (current version is rc.1 as of posting date) I’ve noticed that the srcset attribute of the site logo isn’t creating a https link for the 2x version. Example:
srcset="https://www.zachpoff.com/site/wp-content/uploads/headphones-logo-64px.png 1x, http://www.zachpoff.com/site/wp-content/uploads/headphones-logo-128px.png 2x"
My server is set up to disable mixed content so my retina logo is dropping out. My apologies if this is actually some kind of server problem, but it seems like GP to me.
-ZachDecember 5, 2017 at 5:12 pm #442652Tom
Lead DeveloperLead DeveloperHi Zach,
Thanks for testing!
The URL should inherit the domain name set in “Settings > General”. Can you make sure both of those URLs have https?
December 5, 2017 at 8:00 pm #442703Zach
I actually didn’t have those set to https! After I fixed them, the problem persisted (cleared cache, tried several browsers) until I removed / re-added the retina logo in Customizer. Now the logo appears. (It’s interesting that the 1x link was always https but the 2x link was http.)
One more problem: In Firefox 57 the div with class “site-logo” is too wide when viewed on retina screens. It matches the width of the original logo file (128px) instead of the scaled size that the logo actually appears (64px). Just to be clear, the logo is scaled correctly, but it’s parent div is too wide. (In Safari and Chromium this problem does not appear.)
-Zach
December 5, 2017 at 8:43 pm #442719Tom
Lead DeveloperLead DeveloperYea – the Customizer saves the value that gets set by the uploader. If the value was set as http, it needs to be re-uploaded.
As for the other issue – can you link me to an example? I can’t reproduce that.
Let me know π
December 5, 2017 at 9:44 pm #442727Zach
https://www.zachpoff.com/site/
Compare Firefox 57 to other browsers. FF renders a lot of space between the logo and the site branding.
-ZachDecember 5, 2017 at 9:51 pm #442735Tom
Lead DeveloperLead DeveloperStrange – I don’t have a retina screen, but Firefox Quantum allows us to mimic a retina screen by applying a device pixel ratio (DPR) of 2: https://www.screencast.com/t/VSxHNoiA
December 6, 2017 at 5:48 am #442938Zach
Here’s how it renders on my Macbook retina screen. (Firefox in the background, Chromium in the foreground.)
FF Dev tools inspecting the div:
A Firefox bug perhaps? …
https://bugzilla.mozilla.org/show_bug.cgi?id=1270883
(links to duplicate bug with a lot more info, and a suggestion that it’s still a problem in FF58) May be worth investigating a workaround in the meantime?December 6, 2017 at 10:11 am #443187Tom
Lead DeveloperLead DeveloperYes, looks like a long standing Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1149357
Can you test this as a workaround?
add_filter( 'generate_logo_attributes', 'tu_fix_firefox_logo_width' ); function tu_fix_firefox_logo_width( $atts ) { if ( function_exists( 'the_custom_logo' ) && get_theme_mod( 'custom_logo' ) ) { $data = wp_get_attachment_metadata( get_theme_mod( 'custom_logo' ) ); if ( ! empty( $data ) ) { $atts['width'] = $data['width']; $atts['height'] = $data['height']; } } return $atts; }
December 6, 2017 at 10:36 am #443217Zach
Works great. Thanks.
December 6, 2017 at 10:54 am #443228Tom
Lead DeveloperLead DeveloperNo problem! I’ll get this added into the core theme after some more testing.
December 14, 2017 at 11:32 am #449652Tom
Lead DeveloperLead Developer2.0.1 was just released with this fix.
Thank you! π
February 15, 2018 at 11:36 pm #497902Ethan
Fixed. Sorry π
February 16, 2018 at 10:10 am #498327Tom
Lead DeveloperLead DeveloperNo problem! π
-
AuthorPosts
- You must be logged in to reply to this topic.