I have custom post types that are using sub-categories. I can't figure out how to display the sub-category slug. I am trying to make the sub-category name a class name, but it keeps returning "unrecognized", which isn't right because it is a subcategory. Here's the code:
<?php $categories = wp_get_post_terms($post->ID, 'menu_category', $cat_args); $args = array('parent' => $caregory->term_id); $sub_cats = get_categories( $args ); ?> <div class="menu-item isotope-box-nested <?php foreach($sub_cats as $sub_cat) echo $sub_cat->slug ?>">
Any ideas what I'm doing wrong her?