is there a code to disable lazy loading on just the site logo in WordPress?
2
you can exclude that image from the plugin that you are using for lazy loading.
You can disable Lazy Load on Specific Images by using the Hook Below
Place the Hook in your functions.php file
/* Disable lazy loading by image ID and size */ function wphelp_no_lazy_load_id( $value, $image, $context ) { if ( 'the_content' === $context ) { $image_url = wp_get_attachment_image_url( 4532, 'large' ); // Change the ID and size if ( false !== strpos( $image, ' src="' . $image_url . '"' )) { return false; } } return $value; } add_filter( 'wp_img_tag_add_loading_attr', 'wphelp_no_lazy_load_id', 10, 3 );
Click here to cancel reply.
2
Answers
you can exclude that image from the plugin that you are using for lazy loading.
You can disable Lazy Load on Specific Images by using the Hook Below
Place the Hook in your functions.php file