Created
March 10, 2012 16:48
-
-
Save kachi/2012039 to your computer and use it in GitHub Desktop.
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 | |
function has_thumb_class($classes) { | |
global $post; | |
if( has_post_thumbnail($post->ID) ) { $classes[] = 'foo'; } | |
return $classes; | |
} | |
add_filter('post_class', 'has_thumb_class'); | |
?> | |
/*アイキャッチを持った記事の場合で、且つ、<?php post_class(); ?>を使った場合、そのclassにfooを追加*/ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment