Skip to content

Instantly share code, notes, and snippets.

@Asikur22
Created May 18, 2019 20:01
Show Gist options
  • Select an option

  • Save Asikur22/329dcb26e6053dadbfe075a71520784b to your computer and use it in GitHub Desktop.

Select an option

Save Asikur22/329dcb26e6053dadbfe075a71520784b to your computer and use it in GitHub Desktop.
Add Class to all Image with Filter
/*
* Add Class to all Image
*/
function alter_attr_wpse_102158( $attr ) {
$attr['class'] .= ' img-fluid';
return $attr;
}
add_filter( 'wp_get_attachment_image_attributes', 'alter_attr_wpse_102158' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment