While I use custom template tag to output single post tags:
<?php
echo get_the_tag_list('<p class="text-muted"><i class="fa fa-tags"></i> ',', ','</p>');
?>
How to exclude defined tag name from the tag list?
While I use custom template tag to output single post tags:
<?php
echo get_the_tag_list('<p class="text-muted"><i class="fa fa-tags"></i> ',', ','</p>');
?>
How to exclude defined tag name from the tag list?
Comments are closed.
Well there is no filter to remove terms in
get_the_tag_list
but internally it calls forget_the_terms
so you can add filter there.Consider this example:-
Add a filter on
get_the_terms
and remove it after echoing list. Because it may be called on the page multiple times.And in callback function remove terms by IDs or slugs