Skip to content

Instantly share code, notes, and snippets.

@kamaals
Created February 24, 2014 12:42
Show Gist options
  • Select an option

  • Save kamaals/9187699 to your computer and use it in GitHub Desktop.

Select an option

Save kamaals/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;
}
}
/*--------------------------------------------------------------------*/
?>
@kamaals
Copy link
Author

kamaals 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