display categories of my Custom Post Type

<?php

$taxonomy = 'portfolio_categories';
$terms = get_terms($taxonomy); // Get all terms of a taxonomy

if ( $terms && !is_wp_error( $terms ) ) :
?>
    <ul>
        <?php foreach ( $terms as $term ) { ?>
            <li><a href="<?php echo get_term_link($term->slug, $taxonomy); ?>"><?php echo $term->name; ?></a></li>
        <?php } ?>
    </ul>
<?php endif;?>

?>

Comments

Popular posts from this blog

dynamic create multiple ckeditor onclick event using jquery

Fatal error: Can't use method return value in write context in ci

online visitor counter