Forums

[resolved] How to get custom post type's all custom taxonomies in an array? (2 posts)

  1. Harryson
    Member
    Posted 5 months ago #

    For the love of me, I cannot find the way. There seems to be tree functions that need specific post id, but I want all the taxonomies used by that custom post type.

  2. Harryson
    Member
    Posted 5 months ago #

    $terms = get_terms($taxonomy = 'mytaxonomy');
    foreach ($terms as $term) {
        echo '<li><a href="' . get_term_link($term->slug, $taxonomy) . '">' . $term->name . '</a></li>';
    }

Reply

You must log in to post.

About this Topic