Add tid or name as a class to each item of a taxonomy term I'd like to add the term ID or the name of the term as a class to each one of my taxonomy terms on a node page.

note that I'm not using views, so I wonder how can I achieve this via template.php or any customized tpl.php, I couldn't find any module as well to add class to each term separately.

thanks.
You can modify the output of any field with:

drupal standard field tlps

Possible override templates are:

field.tpl.php

field--content-type.tpl.php

field--field-name--content-type.tpl.php

field--field-type.tpl.php

field--field-name.tpl.php
So according to your specification in comment
&quot;product_display&quot;  and the reference term field is &quot;field_product_specs&quot;
your custom tpl file name should be field--field-product-specs--product-display.tpl.php


OR

Fences


Fences is a an easy-to-use tool to specify an HTML element for each
field. This element choice will propagate everywhere the field is
used, such as teasers, RSS feeds and Views. You don't have to keep
re-configuring the same HTML element over and over again every time
you display the field.