Hello,
It seems that I have the same issue as in threads
https://kriesi.at/support/topic/site-logo-disappears/
https://kriesi.at/support/topic/site-logo-disappears-2/
Please see screenshot
same configuration with lazy loading with WP Rocket
How can I disable the lazyloading just for that position?
Because for the rest of the site lazyloading is working correctly
It happens sometimes. If I clear wp-rocket cache the problem remains
Thank you Mauro
Hey Mauro,
WP Rocket has a filter to exclude lazy loading on selected images. Please try adding following code to bottom of Functions.php file in Appearance > Editor
function rocket_lazyload_exclude_class( $attributes ) {
$attributes[] = 'title="Logo"';
return $attributes;
}
add_filter( 'rocket_lazyload_excluded_attributes', 'rocket_lazyload_exclude_class' );
Best regards,
Yigit
Thank you for the quick answer
‘title=”Logo”‘
with the capital letter?
Mauro
Hi,
Yes paste as it is written.
Best regards,
Jordan Shannon
Thank you
after I opened this ticket I thought that was more a wp-rocket concern to provide a solution and I asked them
They were aware of the issue and they suggest to add in functions.php:
/* Compatibility fix for Enfold Main logo with WP-Rocket Lazy-Load */
add_filter(‘avf_logo_final_output’, ‘mip_fix_enfold_logo_wp_rocket’);
function mip_fix_enfold_logo_wp_rocket($logo) {
return str_replace(“<img”,”<img data-no-lazy=\”1\””,$logo);
}
Which solution do you think is better?
Mauro
Hey,
I referred to their docs to exclude logo from lazyload but if they suggested another solution, please go with their solution :)
Best regards,
Yigit
Ok thank you