By get_the_tags()
you receive an array of tags attached to the current post. So you could do the following:
$tags = get_the_tags();
$tag_ids_to_print = array( 1, 2, 3 ); //List of Tag IDs which you want to be printed
$print_tags = array();
if( is_array( $tags ) ){
foreach( $tags as $tag ){
if( in_array( $tag->term_id, $tag_ids_to_print ) )
$print_tags[] = $tag;
}
}
$tag_list="";
if( count( $print_tags ) > 0 ){
//Execute only, when tags found
$i = 0;
foreach( $print_tags as $tag ){
if( $i == 1 ) $tag_list .= ', ';
$tag_list .= '<a href="' . get_tag_link( $tag->term_id ) . '">' . $tag->name . '</a>';
$i = 1;
}
}
Docs: