WordPress.org

Support

Support » Installation » include a tag in category list ??

include a tag in category list ??

  • 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

Viewing 1 replies (of 1 total)
  • <?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> ';
          }
        }
      }
    }
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘include a tag in category list ??’ is closed to new replies.
Skip to toolbar