wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Display specific content if post has_tag or specific tag

wordpress snippet

Adding this snippet within the loop of your wordpress template will let you display specific content if a post has tags or not. Also note that has_tag(‘tag_name’) suports, tag name, term_id or slug and an array of tag names, term ids and slugs. Also a big thanks to Jeremy for submitting the following.

snippet :  PHPcopy
<?php
if(has_tag()){
    echo 'this post has tags';
    }else {
    echo 'no tags sorry';
}
?>
source →

Did you like this post? If so please share it with your friends. Thanks!

jqsnipp.com | we just launched jquery snippets website