include a tag in category list ??
is there any way to show any tag along with Categories? ??
with the same permalinks as category ?
please help
include a tag in category list ??
is there any way to show any tag along with Categories? ??
with the same permalinks as category ?
please help
<?php
//list all categories and tags that are assigned to posts
$types[0] = 'category';
$types[1] = 'post_tag';
foreach ($types as $type) {
$taxonomy = $type;
$terms = get_terms( $taxonomy, '' );
if ($terms) {
foreach($terms as $term) {
if ($term->count > 0) {
echo '<p>' . '<a href="' . esc_attr(get_term_link($term, $taxonomy)) . '" title="' . sprintf( __( "View all posts in %s" ), $term->name ) . '" ' . '>' . $term->name.'</a> has ' . $term->count . ' post(s). </p> ';
}
}
}
}
?>This topic has been closed to new replies.