I have a taxonomy of menus i.e. Coffee, Tea, Sandwiches, Cakes etc. I want to add more information ‘about’ the taxonomy such as an image that represents it alongside the other pieces of taxonomy information (slug,name,description).
Is this possible, how would you go about it?
Thanks, Stewart
As Mamaduka said there is currently no (native) way of storing meta-data for taxonmies. There is talk of it. But it has stalled since its proving difficult to agree on how best to implement it.
For large amounts of data you might not want to use the options table. Alternatively you can create your own taxonomy meta table. There are a couple plug-ins that currently do this:
http://wordpress.org/extend/plugins/taxonomy-metadata/
http://wordpress.org/extend/plugins/meta-for-taxonomies/
Currently only way to store additional metadata for taxonomies is, adding them to WordPress options (
wp_options
table). Just for an images, you can remove kses filter from term’s description and insert image there.About storing taxonomy metadata in options tables, you can see Brad Williams post: http://www.strangework.com/2010/07/01/how-to-save-taxonomy-meta-data-as-an-options-array-in-wordpress/
I coded a class that stores metadata for taxonomy terms in the options table and working with it is fairly simple ex:
this will add a text field, textarea field and an image field.
And getting the stored data is also very simple:
currently the class supports:
to read more about it look at : WordPress taxonomies extra fields the easy way
I wrote a Taxonomy Meta Script for WordPress, which can help you easily implement taxonomy meta.