Skip to content

Instantly share code, notes, and snippets.

@MjHead
Created March 26, 2018 10:27
Show Gist options
  • Save MjHead/d9d73cf79c373dd8009bf227155fbff4 to your computer and use it in GitHub Desktop.
Save MjHead/d9d73cf79c373dd8009bf227155fbff4 to your computer and use it in GitHub Desktop.
<?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