Friday 15 July 2011

php - WordPress get tags for Custom Post Type -



php - WordPress get tags for Custom Post Type -

trying tags custom post type called public-blob code pulling in tags single blog post not public-blog cpt.

code is:

$posttags = get_the_tag_list(); if ($posttags) { foreach($posttags $tag) { echo '<a href="' . get_tag_link( $tag->term_id ) .'">' . $tag->name . '</a>'; } }

any help great.

you should utilize function get_the_term_list() function get_the_tag_list() allow set taxonomy.

btw function get_the_tag_list() , get_the_term_list() not homecoming array should set before, separator, , after in function.

php wordpress tags custom-post-type

No comments:

Post a Comment