$tag_group_labels
-
Hello,
First and foremost, great plugin. I use it all the time.
I’m running into difficulties trying to add the label for group tags and I’m not sure what I’m doing wrong.
I’ve used this code…
$tags = get_the_tags(); $html = '<div class="tags">' . "\r\n" . '<ul>' . "\r\n" . '<li>Tags: </li>' . "\r\n" . ''; foreach ( $tags as $tag ){ $tag_link = get_tag_link( $tag->term_id ); $term = get_queried_object(); $tag_group_labels = get_option( 'tag_group_labels', array() ); $tag_group_ids = get_option( 'tag_group_ids', array() ); $i = array_search($term->term_group, $tag_group_ids); $html .= "<li><a href=\"{$tag_link}\" title=\"{$tag->description}\n\n"; $html .= "Tagged in " . $tag->count . " posts\n\n"; $html .= "Catergory: " . $tag_group_labels[$i] . " "; $html .= "\"class=\"group" . $tag->term_group . " " . $tag->slug . " tag\">"; $html .= "{$tag->name}"; $html .= "</a></li> \n"; } $html .= '</ul>' . "\r\n" . '</div><!--end tags-->'; echo $html;
..but all its spitting out is “not assigned”
I have my tags and tag groups set up as I’m able to use the other functions $tag->description, $tag->slug, $tag_link, etc. when styling the output.
Could you point me in the right direction?
Regards,
Sam
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘$tag_group_labels’ is closed to new replies.