Created
November 4, 2012 17:18
-
-
Save Mr2P/4012654 to your computer and use it in GitHub Desktop.
Wordpress: Append span tag to each "tag item" returned from get_the_tag_list()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$tags_list = get_the_tag_list( 'Tags: ', __( ', ', 'text_domain' ) ); | |
preg_replace_callback('/<a\b[^>]*>(.*?)<\/a>/',create_function('$matches','return "$matches[1]";'),$tags_list); | |
preg_replace('/(<a\b[^>]*>)(.*?)(<\/a>)/', '$1<span class="tag-label">$2</span>$3', $tags_list); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment