Skip to content

Instantly share code, notes, and snippets.

@bacoords
Created October 20, 2021 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bacoords/b10d1dd30e091cb2f4ce42a4e3f27f7f to your computer and use it in GitHub Desktop.
Save bacoords/b10d1dd30e091cb2f4ce42a4e3f27f7f to your computer and use it in GitHub Desktop.
Remove lazy loading from WordPress custom logo
<?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