Created
February 24, 2014 12:42
-
-
Save kamaals/9187699 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 | |
| /*--------------------------------------------------------------------*/ | |
| add_filter('post_class', 'elephas_post_class_hook' ); | |
| if( !function_exists( 'elephas_post_class_hook' ) ){ | |
| function elephas_post_class_hook( $post_class ){ | |
| //Global post object | |
| global $post; | |
| foreach( (get_the_category( $post->ID ) ) as $category) { | |
| $post_class[] = $category->slug; | |
| } | |
| $post_class[] = 'block-grid'; | |
| return $post_class; | |
| } | |
| } | |
| /*--------------------------------------------------------------------*/ | |
| ?> |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made a comment through php curl