Created
April 30, 2020 16:57
-
-
Save emulsion-io/a0be9548b20aec247c1e84405625abf2 to your computer and use it in GitHub Desktop.
add attr lazyload functions.php wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function add_loading_lazy_to_images($attr) { | |
$attr['loading'] = 'lazy'; | |
return $attr; | |
} | |
add_filter( 'wp_get_attachment_image_attributes', 'add_loading_lazy_to_images'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment