waynedunkley
3/3/2015 - 1:04 AM

List Wordpress Post Tags in format 'Tags: tag1, tag2, tag3'

List Wordpress Post Tags in format 'Tags: tag1, tag2, tag3'

<?php
  $post_tags = wp_get_post_tags($post->ID);
  if( !empty($post_tags) ){ ?>
    <div class="tags">
      <p>Tags:
        <?php
          foreach ($post_tags as $tag){ ?>
            <a href="#"><?php echo $tag->name;?></a><?php if( end($post_tags) !== $tag ){ echo ','; }; ?>
          <?php
          };
        ?>
      </p>
    </div>
  <?php
  }
?>