0

I have created custom post type with 'members'

 <?php
$member = new CPT(array(
    'post_type_name' => 'members',
    'singular' => __('Members', 'c2s'),
    'plural' => __('Members', 'c2s'),
    'slug' => 'Members'
),
   array(
    'supports' => array('title', 'editor', 'thumbnail', 'comments'),
    'menu_icon' => 'dashicons-groups'
));

$member->register_taxonomy(array(
    'taxonomy_name' => 'members_tags',
    'singular' => __('Members Tag', 'c2s'),
    'plural' => __('Members Tags', 'c2s'),
    'slug' => 'member-tag'
));

?>

I am trying to print/display members_tags into the individual post. enter image description here

1
2

You can use get_the_term_list() to output a list of links:

<?php echo get_the_term_list( get_the_ID(), 'members_tags', '', ',' ); ?>

That will output a comma-separated list of links to attached member_tags.

If you want the raw tags so you have more control over HTML, use get_the_terms()

<?php $member_tags = get_the_terms( get_the_ID(), 'members_tags' ); ?>
1
  • Jacob, Thanks for answered. I had solved by same you mentioned, It is good for who are new getting trouble though. I appreciated.
    – Rabin Rai
    Nov 9 '18 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.