I want to have a badge(bootstrap) inside my thumbnail, so i check the post throu a loop to see that post have that tag and print it, but i didnt find a function to print a tag based on tags id.
<?php if(has_post_thumbnail()) : ?>
<div class="post-thumbnail">
<?php $t = wp_get_post_tags($post->ID);
for($i=0;$i<count($t);$i++){
if($t[$i]==317){
echo '<span class="badge badge-primary" id="badge-aks">'.???.'</span>';
}
endif;
}
?>
<?php the_post_thumbnail(); ?>