Viewing 3 replies - 1 through 3 (of 3 total)
  • Adding on to the code provided in your previous post, this should do the trick:

    <?php
    $args = array(
        'type'        => 'childrenscakes',
        'taxonomy'    => 'childrenscakes-category',
    );
    
    $categories = get_categories( $args );
    foreach($categories as $cat) {
        echo '<a href="' . get_category_link($cat->term_id) . '">' . $cat->name . '</a><br/>';
    }
    ?>

    Please review get_categories() from the Codex for more examples.

    Thread Starter The_Gray_Wolf

    (@the_gray_wolf)

    Could I use custom taxonomies (instead of categories)?

    get_term_link( $term, $taxonomy = '')

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show only the posts that belong to a specific category?’ is closed to new replies.