Skip to content

Instantly share code, notes, and snippets.

@kamaal-
Created February 24, 2014 12:42
Show Gist options
  • Save kamaal-/9187699 to your computer and use it in GitHub Desktop.
Save kamaal-/9187699 to your computer and use it in GitHub Desktop.
<?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;
}
}
/*--------------------------------------------------------------------*/
?>
@kamaal-
Copy link
Author

kamaal- commented Nov 18, 2014

I made a comment through php curl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment