6

I'm looking for solution that will display all the tags that are used on a custom post type. I just want to list them all because I'm going to add jQuery code on each tag. :)

  • 1
    Please avoid words like coz. There are tons of non native english speakers here and probably some will not understand what you wrote later on. At least it's no chat here. Thanks. – kaiser Aug 31 '12 at 1:06
7

wp_get_object_terms will have your answer.

wp_get_object_terms( $post_ids, 'post_tag', $optional_args );

There is also get_the_terms which is simpler but also gets the job done.

get_the_terms( $id, 'post_tag');

  • Thanks, it takes time for me to accomplish and now i'm done.. Thanks @sneek.. you are awesome.. – markyeoj Jul 26 '12 at 6:37
2

the_terms()

Both the_tags() and the_terms() uses get_the_term_list(), the different is that the_tags() has the default put in for post_tag.

Watch them in wp-includes/category-template.php

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.