Skip to content

Instantly share code, notes, and snippets.

@braginteractive
Created April 11, 2017 21:58
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 braginteractive/a0e07ad4c218f0dbdebda08ff0e244f7 to your computer and use it in GitHub Desktop.
Save braginteractive/a0e07ad4c218f0dbdebda08ff0e244f7 to your computer and use it in GitHub Desktop.
Filter to add class to WordPress tags
<?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