I have created a new post type named "Project". And I registered 1 taxonomy "Tags" in it as follows:


I entered the tags into 1 article in post type "Project".

If you want to enter an article, it will display all the tags in that article.

Can someone help me. Thank you!

  • Please include the code in your post and highlight it. What values does this link have as soon as it goes 404?
    – leymannx
    Commented Mar 29, 2019 at 18:52

3 Answers 3


Considering you mention having registered a custom taxonomy instead of using the native tags, the functions the_tags() and get_tags will not work.

you need to get your custom taxonomy terms by using get_the terms(). Usage is not much different from using native tags, but you have to pass the post_type as a variable. See the Wordpress codex on this: https://developer.wordpress.org/reference/functions/get_the_terms/


You have to be careful when creating a custom post type with taxonomy and the same namespace "tags", since tags are already registered by WordPress default for the post type posts. Maybe the renaming of the taxonomy to project-tags or something else would make sense. Otherwise the taxonomy will be mixed up by WordPress.

To show all tags you can use PHP:

the_tags('<ul class="taglist"><li>', '</li><li>', '</li></ul>');

Note: This function must be within the loop (archive.php or single.php).


Check out get_the_tag_list() to retrieve all the tags:



$separate_meta = __( ', ' );
echo $tags_list = get_the_tag_list( '', $separate_meta );


 $tags = get_tags();
 if ($tags) {?>
  <ul class="tags">
    foreach ($tags as $tag) {
    echo '<li><a href="' . get_tag_link( $tag->term_id ) . '" 
    title="' . sprintf( __( "View all posts in %s" ), $tag->name ) . '" ' . '>' . $tag->name.'</a></li>';
<?php }?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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