Created
May 18, 2019 20:01
-
-
Save Asikur22/329dcb26e6053dadbfe075a71520784b to your computer and use it in GitHub Desktop.
Add Class to all Image with Filter
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
| /* | |
| * 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