List taxonomies with thumbnails

How to get the data back

When you look at your code, then you got get_option( "taxonomy_{$t_id}" ) in it, which actually calls the value from the DB options table. So you should simply replace the $t_id with your actual term id.

The term ID can be retrieved via

  • get_query_var( 'tag_id' ) for Tags on tag archive pages
  • get_query_var( 'cat' ) for Categories on cat archive pages
  • get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) )->term_id for custom taxonomy and post format pages.

Why it is NOT recommended to do this!

You’re saving one additional entry in your DB options table per tag/term/category/taxon.

This means with a growing number of taxonomy terms, tags or categories, you’re quickly polluting your table with stuff that doesn’t belong there. Its also not recommended to prefix custom stuff with a generic name like taxonomy_. Try to find this again, when you don’t need it anymore. There’s also a high risk, that you may catch stuff that doesn’t belong to your custom “solution”. Always! use a proper prefix like wpse38656_ for DB entries.

Leave a Comment