- This topic has 15 replies, 2 voices, and was last updated 5 years ago by
Leo.
-
AuthorPosts
-
April 7, 2021 at 9:26 am #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!
April 7, 2021 at 10:53 am #1725231Leo
StaffCustomer SupportHi there,
Any chance you can link us to the site in question?
You can use the private information field.
Let me know 🙂
April 7, 2021 at 11:12 am #1725254Heidi
ok. I will send in the private information.
any chance a theme update is coming out soon for this issue?
April 7, 2021 at 12:09 pm #1725326Leo
StaffCustomer SupportCan you try switching the theme structure from Float to Flex under Customizer > General?
April 7, 2021 at 12:20 pm #1725331Heidi
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.
April 7, 2021 at 12:32 pm #1725340Leo
StaffCustomer SupportHmm that shouldn’t happen. Which elements are you referring to?
Can you change it so I can see?
April 7, 2021 at 1:09 pm #1725372Heidi
I have it switched to Flex now.
The blog content and side bar jump around from right to left (and left to right).
April 7, 2021 at 1:14 pm #1725380Leo
StaffCustomer SupportI just checked the “Post Title Removed” post but not seeing the issue at all.
April 7, 2021 at 1:19 pm #1725383Heidi
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.
April 7, 2021 at 1:22 pm #1725387Heidi
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.
April 7, 2021 at 1:31 pm #1725390Leo
StaffCustomer SupportYup 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-heightJust edit the width and height numbers.
April 7, 2021 at 1:40 pm #1725400Heidi
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).
April 7, 2021 at 2:00 pm #1725415Heidi
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?
April 7, 2021 at 2:03 pm #1725417Leo
StaffCustomer SupportIf 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.
April 7, 2021 at 2:17 pm #1725432Heidi
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).
-
AuthorPosts
- You must be logged in to reply to this topic.