Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Add class to all featured images
function generate_custom_image_attributes( $attr ) {
remove_filter('wp_get_attachment_image_attributes','generate_custom_image_attributes');
if ( is_single() )
$attr['class'] .= ' no-lazy';
return $attr;
}
add_filter('wp_get_attachment_image_attributes','generate_custom_image_attributes');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.