- This topic has 29 replies, 5 voices, and was last updated 5 years, 4 months ago by
Elvin.
-
AuthorPosts
-
November 20, 2020 at 9:36 am #1539227
William
Hi there,
I uploaded an SVG logo for my site here. Since loading, I notice there is a CLS movement of the logo going from big to small – why is this the case with such a SVG logo on Generate Press and can it be fixed please?
Kind regards,
Will
November 20, 2020 at 10:06 am #1539264Leo
StaffCustomer SupportHi there,
Can you test if the issue is resolved when WP Rocket is disabled?
I think it’s a lazy loading issue.
November 20, 2020 at 10:42 am #1539294William
I’ve disabled WP Rocket and EWWWW image optimizer and the issue still persists.
November 20, 2020 at 11:07 am #1539337Leo
StaffCustomer SupportCan you disable WP Rocket so I can run the site through PageSpeed Insight and try to determine the issue?
November 20, 2020 at 11:55 am #1539385William
Sure thing, deactivated
November 20, 2020 at 2:56 pm #1539496Leo
StaffCustomer SupportI’m still seeing WP Rocket activated.
Can you confirm?
November 23, 2020 at 2:59 pm #1543188William
Sure, it is deactivated
November 24, 2020 at 1:20 am #1543703David
StaffCustomer SupportHi there,
first try excluding the Logo image from being lazy loaded by adding this PHP Snippet to your site:
function rocket_lazyload_exclude_class( $attributes ) { $attributes[] = 'class="is-logo-image"'; return $attributes; } add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );November 24, 2020 at 3:55 am #1543900William
Hi there,
I had deactivated WP Rocket and the issue still persists – added the above but has nad no impact.
November 24, 2020 at 5:10 am #1544019David
StaffCustomer SupportSome other plugin or the litespeed cache is lazyloading the image.
Can you disable whatever else may be adding lazyload to test if thats the issue.November 24, 2020 at 8:04 am #1544551William
I’ve disabled all plugins that could cause this and the issue persists
November 24, 2020 at 8:32 am #1544595David
StaffCustomer SupportFirst try removing the Retina version of the image, this is not required for SVG and can be one cause.
If still an issue try changing the Customizer > General –> Structure to Flexbox.
November 24, 2020 at 10:15 am #1544802William
This unfortunately does not seem to make much difference – removed the retina logo and changed structures
November 24, 2020 at 5:09 pm #1545284Elvin
StaffCustomer SupportHi,
Consider adding fixed width and height attribute to your logo
<img>.You can change the markup of your logo to add attributes by using this filter: https://docs.generatepress.com/article/generate_logo_output/
For example:
add_filter( 'generate_logo_output', 'tu_logo_attributes', 10, 3 ); function tu_logo_attributes( $output, $logo_url, $html_attr ) { printf( '<div class="site-logo"> <a href="%1$s" title="%2$s" rel="home"> <img %3$s width="235" height="100" /> </a> </div>', esc_url( apply_filters( 'generate_logo_href' , home_url( '/' ) ) ), esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ), $html_attr ); }Here’s how to add PHP – https://docs.generatepress.com/article/adding-php/
November 25, 2020 at 10:39 am #1546896William
Thank you – that seems to stop the logo going large to small – however, the CLS issue of the logo still exists – this time, when on load, the logo not being there causes the header to be a certain height, and then to increase in height when the image loads.
I think this could be fixed with CSS to make header on desktop a certain height, can you provide please?
-
AuthorPosts
- You must be logged in to reply to this topic.