Skip to content

Instantly share code, notes, and snippets.

@andrearufo
Created January 12, 2015 17:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrearufo/da5485a9f338c9d04d9f to your computer and use it in GitHub Desktop.
Save andrearufo/da5485a9f338c9d04d9f to your computer and use it in GitHub Desktop.
Wordpress the_tags() replacing functions with hashtags
function odd_the_tags($before, $sep, $after){
if( $tags = get_the_tags() ) {
echo $before;
foreach( $tags as $tag ) {
$sep = ( $tag === end( $tags ) ) ? $after : $sep;
echo '<a href="' . get_term_link( $tag, $tag->taxonomy ) . '">#' . $tag->name . '</a>' . $sep;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment