Created
March 26, 2018 10:27
-
-
Save MjHead/d9d73cf79c373dd8009bf227155fbff4 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 my_smart_listing_classes( $classes ) { | |
global $post; | |
$terms = get_the_terms( $post->ID, 'category' ); | |
if ( ! empty( $terms ) ) { | |
foreach ( $terms as $term ) { | |
$classes[] = 'category-' . $term->slug; | |
} | |
} | |
return $classes; | |
} | |
add_filter( 'jet-blog/smart-listing/post/classes', 'my_smart_listing_classes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment