// // BLOGALAXIA Tags // function bget_tag_link( $tag_id ) { global $wp_rewrite; $taglink = $wp_rewrite->get_tag_permastruct(); // $taglink = "/tags/".$tag; $tag = &get_term($tag_id, 'post_tag'); if ( is_wp_error( $tag ) ) return $tag; $slug = $tag->slug; if ( empty($taglink) ) { $file = 'http://www.blogalaxia.com'; $taglink = $file . '?tag=' . $slug; } else { $taglink = str_replace('%tag%', $slug, $taglink); $taglink = str_replace ("tag","tags",$taglink); $taglink = 'http://www.blogalaxia.com' . user_trailingslashit($taglink, 'category'); } return apply_filters('tag_link', $taglink, $tag_id); } function bget_the_tags( $id = 0 ) { global $post; $id = (int) $id; if ( ! $id && ! in_the_loop() ) return false; // in-the-loop function if ( !$id ) $id = (int) $post->ID; $tags = get_object_term_cache($id, 'post_tag'); if ( false === $tags ) $tags = wp_get_object_terms($id, 'post_tag'); $tags = apply_filters( 'get_the_tags', $tags ); if ( empty( $tags ) ) return false; return $tags; } function bget_the_tag_list( $before = '', $sep = '', $after = '' ) { $tags = bget_the_tags(); if ( empty( $tags ) ) return false; $tag_list = $before; foreach ( $tags as $tag ) { $link = bget_tag_link($tag->term_id); if ( is_wp_error( $link ) ) return $link; $tag_links[] = ''; } $tag_links = join( $sep, $tag_links ); $tag_links = apply_filters( 'the_tags', $tag_links ); $tag_list .= $tag_links; $tag_list .= $after; return $tag_list; } function bthe_tags( $before = 'Blogalaxia: ', $sep = ', ', $after = '' ) { $return = bget_the_tag_list($before, $sep, $after); if ( is_wp_error( $return ) ) return false; else echo $return; }