Site logo

[Support request] Set an explicit width and height on image for logo

Home Forums Support [Support request] Set an explicit width and height on image for logo

Home Forums Support Set an explicit width and height on image for logo

  • This topic has 15 replies, 2 voices, and was last updated 5 years ago by Leo.
Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1725134
    Heidi

    I need to Set an explicit width and height on image elements to reduce layout shifts and improve CLS.

    The failing element is the logo.

    I have read through solutions on other posts and installed the Code Snippets plugin and copied/pasted the PHP (updating the width/height).

    But, the speed test still gives the same error.

    And with the Code Snippet set to Run snippet everywhere, the Total Blocking Time goes up. And still have the same error for the CLS.

    Can you please advise?

    Thank you!

    #1725231
    Leo
    Staff
    Customer Support

    Hi there,

    Any chance you can link us to the site in question?

    You can use the private information field.

    Let me know 🙂

    #1725254
    Heidi

    ok. I will send in the private information.

    any chance a theme update is coming out soon for this issue?

    #1725326
    Leo
    Staff
    Customer Support

    Can you try switching the theme structure from Float to Flex under Customizer > General?

    #1725331
    Heidi

    I just tried Flex and I could see elements shifting from left to right (or maybe right to left), which seems like would be another CLS problem, so I changed it back to Floats.

    #1725340
    Leo
    Staff
    Customer Support

    Hmm that shouldn’t happen. Which elements are you referring to?

    Can you change it so I can see?

    #1725372
    Heidi

    I have it switched to Flex now.

    The blog content and side bar jump around from right to left (and left to right).

    #1725380
    Leo
    Staff
    Customer Support

    I just checked the “Post Title Removed” post but not seeing the issue at all.

    #1725383
    Heidi

    did you try it in Chrome? that is where I am seeing it, but maybe I need to clear my cache or something? It’s not happening in FireFox or Edge.

    #1725387
    Heidi

    The change also seems to break the mobile page score, if you run it through https://developers.google.com/speed/pagespeed/insights/. the mobile score was 100, and drops to 41.

    #1725390
    Leo
    Staff
    Customer Support

    Yup I was using Chrome.

    Flexbox is the newer/better version so it shouldn’t cause any issues like that.

    If you prefer to stick with float then you will need this PHP snippet:
    https://docs.generatepress.com/article/generate_logo_output/#setting-a-width-and-height

    Just edit the width and height numbers.

    #1725400
    Heidi

    I will try Flexbox then, since you do not see the issue and will assume it’s my cache.

    Does the snippet fix both mobile and desktop? In the Code Snippets options, do I choose “Run snippet everywhere?

    is this the ONLY snippet I need (I had copied/pasted another one before contacting support).

    #1725415
    Heidi

    Also, I cleared my chrome cache and I still see the blog content/sidebar shift when the page loads. if I record my screen is there a way to share the recording with you?

    #1725417
    Leo
    Staff
    Customer Support

    If you are using the Flexbox version then the snippet is not needed.

    A screen recording doesn’t really help for problems like these unfortunately.

    What if you use incognito mode?

    I doubt this is a theme issue as it doesn’t happen across all browsers.

    The next step would be to disable all plugins except GP Premium and see if that helps with the issue.

    #1725432
    Heidi

    okay. thanks. the problem does happen in incognito mode as well. it seems odd though that it’s just happening to me, so I guess will try the plugin idea later (or tomorrow).

Viewing 15 posts - 1 through 15 (of 16 total)
  • You must be logged in to reply to this topic.