The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Need help for custom post type

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #277360

    I have created custom post type, and also created some categories,
    Now the point is, i want to show the category name on the custom post type single page.

    Please provide me the code for showing the custom post type category on a single page.


    Try this for wp:

    $taxonomy = 'your taxonom';
    $terms = get_terms($taxonomy); // Get all terms of a taxonomy
    if ( $terms && !is_wp_error( $terms ) ) :
            <?php foreach ( $terms as $term ) { ?>
                <li><a href="<?php echo get_term_link($term->slug, $taxonomy); ?>"><?php echo $term->name; ?></a></li>
            <?php } ?>
    <?php endif;?>
Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Back End’ is closed to new topics and replies.