title: If has tag, get tag, else. [Wordpress, PHP, Function]
body: <p>I'm trying to get wordpress to show tag if there is a tag. but when there is no tag, other element are affected and hidden if there is no tag. I want it to show "No tag Available", when there is no tag, not hiding the whole element. </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>if ( !has_tag() ) return;
      $tags = get_the_tags(); 
      foreach ( $tags as $tag ) {
          $tag_link = get_tag_link( $tag-&gt;term_id );    
      }
   
      echo "&lt;li class='list-group-item'&gt;&lt;a href='{$url}' class='btn btn-danger btn-sm'&gt;&lt;strong&gt;Original Size&lt;/strong&gt; ({$original_w}x{$original_h})&lt;/a&gt;&amp;nbsp;&lt;a href='{$tag_link}' class='btn btn-danger btn-sm'&gt;&lt;strong&gt;Show more {$tag-&gt;name} wallpaper&lt;/strong&gt;&lt;/a&gt;&lt;/li&gt;";</code></pre>
  </div>
  </div>
  </p>
  
  <p>When there is a tag in the post
  <a href="http://i.stack.imgur.com/Tl06G.png" rel="nofollow">http://i.stack.imgur.com/Tl06G.png</a></p>
  
  <p>When there is no tag in the post
  <a href="http://i.stack.imgur.com/jUyAZ.png" rel="nofollow">http://i.stack.imgur.com/jUyAZ.png</a></p>
  
  <p>I want to show the elements even where there is no tag in the post.</p>
  
  <p>FYI, I newbie to PHP.</p>