[Resolved] High Cumulative Layout Shift

Home Forums Support [Resolved] High Cumulative Layout Shift

Home Forums Support High Cumulative Layout Shift

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1545725
    Joakim

    Hello,

    I’m struggling with high CLS for both mobile and desktop, tried to solve it using the forum – but nothing has worked out.

    It seems like it has something to do with the menu and logo. Took away the menu name to give more space for the logo, but no success.

    It is shifting one row under the header (when looking into dev tools).

    Thanks, Joakim

    #1545764
    David
    Staff
    Customer Support

    Hi there,

    couple of things:

    1. You logo is being lazy loaded, if that is a WP Rocket option then you can add this PHP Snippet to stop that:

    function rocket_lazyload_exclude_class( $attributes ) {
    	$attributes[] = 'class="is-logo-image"';
    
    	return $attributes;
    }
    add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    2. Looks like you have Critical CSS enabled in WP Rocket. Unless you manually configure this you will have issues. Disable this option.

    #1545789
    Joakim

    Thanks David!

    Already added the function, but disabled “Optimize CSS delivery” in WP Rocket and it worked like a charm.

    Thanks for great support!

    Br, Joakim

    #1545809
    David
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.