Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

tab7x on "How to get all tags of current language?"

$
0
0

Hi,
I translated my tags using xili-tidy-tag and I wrote this PHP code that return all tags

<?php
if( is_page_template( 'my-page-template.php' ) || is_tag() )
{
	$tags = get_tags();
	$current_tag=get_query_var('tag');
	$html = '<ul class="posts-by-tag-list">';
	foreach ( $tags as $tag ) {
		if($tag->name == $current_tag) {
			$class = ' class="current_tag_item"';
		}
		else
			$class = '';
		$tag_link = get_tag_link( $tag->term_id );

		$html .= "<li ".$class."><a href='{$tag_link}' title='{$tag->name} Tag' class='{$tag->slug}'>";
		//$html .= "{$tag->name}</a></li>";
		$html .= ucfirst($tag->name)."</a></li>";
	}
	$html .= '</ul>';
	echo $html;
}
?>

How can I get only tags of selected language?
Thanks


Viewing all articles
Browse latest Browse all 8245

Trending Articles