Created
August 21, 2014 04:04
-
-
Save designbuildtest/bc5908df335a9e886027 to your computer and use it in GitHub Desktop.
wp_attachment_is_image() & post_class()
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
| <?php | |
| /** | |
| * Add custom classes to the array of post classes. | |
| */ | |
| function sendtheme_post_classes( $classes ) { | |
| if ( wp_attachment_is_image() ) { | |
| $classes[] = 'attachment-image'; | |
| } | |
| return $classes; | |
| } | |
| add_filter( 'post_class', 'sendtheme_post_classes' ); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment