Created
October 20, 2021 18:15
-
-
Save bacoords/b10d1dd30e091cb2f4ce42a4e3f27f7f to your computer and use it in GitHub Desktop.
Remove lazy loading from WordPress custom logo
This file contains hidden or 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
<?php | |
function understrap_get_custom_logo_attributes( $custom_logo_attr ){ | |
$custom_logo_attr['data-no-lazy'] = '1'; | |
$custom_logo_attr['loading'] = 'eager'; | |
return $custom_logo_attr; | |
} | |
add_filter( 'get_custom_logo_image_attributes', 'understrap_get_custom_logo_attributes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment