How to show tags under single post’s content

In this tutorial I`ll show you what you need to do to show the post tags under its content (if it is not built-in your theme). For the unfamiliar, each post can be assigned a tag, tags are unique and allow you to sort posts by the tags they have assigned, check tag popularity,show a tag cloud widget etc.  If your theme isn’t showing the tags under the post content or you want to include that functionality in the theme you`re developing, this code snippet is for you.


$tags = wp_get_post_tag<wbr />s($post->ID);
$TagsList = '<span class"all-tags">';
foreach($tags as $tag){
$TagsList .= '<span class="tag">'.$tag->name.' </span> ';

$TagsList .= '</span>';
//var_dump($TagsL<wbr />ist);


In order to use the code you have to open your theme`s single.php and place the above code somewhere in the beginning of the file/just above the get_header.php for example/ find the place where you want your post tags to appear and type
<?php echo $TagsList; ?>