the_tags without hyperlinks?

How can I call the_tags as a list without hyperlinks?

Related posts

Leave a Reply

2 comments

  1. It shows the tags of your post. If you use “get_tags()” you will list all tags of wordpress.

       <?php
        if (is_array(get_the_tags())) {
               $tags = get_the_tags();
               foreach($tags as $tag) {
                  echo "$tag->name";
               } 
            } 
        ?>
    

    You should check the get_the_tags() if “is_array()” or you’ll get error case the_post() doesn’t have a tag .