Skip to content

Instantly share code, notes, and snippets.

@epicdaze
Created July 1, 2011 22:02
Show Gist options
  • Save epicdaze/1059498 to your computer and use it in GitHub Desktop.
Save epicdaze/1059498 to your computer and use it in GitHub Desktop.
#wordpress - return the post tags and strip whitespace from each #tags #whitespace
<!-- /* http://wordpress.stackexchange.com/questions/21707/ */ -->
<?php
$tags = get_the_tags();
$tag_links = array();
foreach((array)$tags as $tag)
$tag_links[] = str_replace(' ', '', $tag->name);
echo implode(' ', $tag_links);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment