Like Lifehacker and several other sites, would like to know how to add # before tags displayed on the site. for e.g. instead of a tag like "abc", how about "#abc". - is there a way to automatically add # across all the tags present in the system?
-
Global changes are usually overly broad and can cause unwanted issues. It is better practice to determine specific parts of theme where this should be applied, relevant function and work from there.– RarstCommented Jun 3, 2011 at 19:24
-
Yes. In single.php - this is precisely where I want to add this.– ashCommented Jun 13, 2011 at 14:34
-
possible duplicate of Add # before each tag– Nicolai GrossherrCommented Jul 21, 2015 at 16:03
Add a comment
|
1 Answer
You could just do cosmetic changes on your theme with some javascript:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.tags li a').prepend('#');
});
</script>
<ul class="tags">
<li><a href="/tag/sometag/">sometag</a></li>
</ul>