0
votes

With custom post type, i need to use category slug for my class (css).

<?php 
            global $post;
            $terms = wp_get_post_terms($post->ID, 'typeresources');
            if ($terms) {
                $output = array();
                foreach ($terms as $term) {
                if ($term->term_id != 14)
                {
                $output[] = '<div class="cat-resources">' .$term->name .'</div>';
                }
                }
                echo join( ' ', $output );
            };
            ?>

Would like to add at my "cat-resources class" the categroy slug

How can i do that ?