<div class="time-serving">
<?php
$output = '';
$posttags = get_the_tags();
if ($posttags) {
$img_path = get_bloginfo('stylesheet_directory');
foreach($posttags as $tag) {
$image = 'tag_icon_' . $tag->slug . '.png';
$link = get_tag_link( $tag->term_id);
$output .= $separator . '<a href="' . $link . '" class="img-tags">';
$output .= '</a>';
$separator =''; // this adds a space between the icons; you can change it
if(file_exists(STYLESHEETPATH.'/img/'.$image)) {
$output .= $separator . '<a href="' . $link . '" class="img-TAGS-top">';
$output .= '<img src="' . $img_path.'/img/'.$image . '" alt="tag ' . $tag->name .' icon" class="imagesTag"} />';
$output .= '</a>';
} else {
$output .= '';
}
}
echo $output;
}
?>
</div>
tag_icon_tagname from wp - add images of tag on ftp
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.