Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a custom post type called 'camps', which has tags associated with it, registered as 'camps_tag'

I have managed to list all of the posts from a certain category within the 'camps' cpt, but how can I list the tags associated with the post?

Any help would be greatly appreciated.

share|improve this question
add comment

1 Answer 1

You want to look into the_terms or its big brother get_the_terms. It's how you display custom taxonomies on the front end -- similar to the_category or the_tags.

Example:

<?php
// somewhere in a template file, inside the loop
the_terms(
    $post->ID, // object ID
    'camps_tag', // your custom taxonomy
    '<p><strong>Tags: </strong></p>', // before the list
    ', ', // between list items
    '</p>' // after the list
);
share|improve this answer
    
Thank you, I wasn't sure if I was supposed to be looking at tags or taxonomy documentation. Will give that a go –  Chris Nov 20 '12 at 16:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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