Last active
May 5, 2016 07:35
-
-
Save generatepress/c5bc0ee37bb767a703c5 to your computer and use it in GitHub Desktop.
Add class to all featured images
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 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