347 | | foreach ( (array) get_the_category($post->ID) as $cat ) { |
348 | | if ( empty($cat->slug ) ) |
349 | | continue; |
350 | | $classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->cat_ID); |
| 347 | if( is_object_in_taxonomy( $post->post_type, 'category' ) ) { |
| 348 | foreach ( (array) get_the_category($post->ID) as $cat ) { |
| 349 | if ( empty($cat->slug ) ) |
| 350 | continue; |
| 351 | $classes[] = 'category-' . sanitize_html_class($cat->slug, $cat->cat_ID); |
| 352 | } |
354 | | foreach ( (array) get_the_tags($post->ID) as $tag ) { |
355 | | if ( empty($tag->slug ) ) |
356 | | continue; |
357 | | $classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id); |
| 356 | if( is_object_in_taxonomy( $post->post_type, 'post_tag' ) ) { |
| 357 | foreach ( (array) get_the_tags($post->ID) as $tag ) { |
| 358 | if ( empty($tag->slug ) ) |
| 359 | continue; |
| 360 | $classes[] = 'tag-' . sanitize_html_class($tag->slug, $tag->term_id); |
| 361 | } |