Created
April 11, 2017 21:58
-
-
Save braginteractive/a0e07ad4c218f0dbdebda08ff0e244f7 to your computer and use it in GitHub Desktop.
Filter to add class to WordPress tags
This file contains hidden or 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
<?php | |
/** | |
* Add Class to Tags | |
*/ | |
function helpwp_add_tag_class($links) { | |
return str_replace('<a href="', '<a class="tag btn btn-sm btn-primary" href="', $links); | |
} | |
add_filter( "term_links-post_tag", 'helpwp_add_tag_class'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment