[wp-hackers] Term Meta - Trac'd already?

Otto otto at ottodestruct.com
Wed Jul 13 19:58:26 UTC 2011

On Wed, Jul 13, 2011 at 2:45 PM, Daniel Cameron <dan at sproutventure.com> wrote:
> We built a theme that styles the site differently based on where you're at
> on a site. Think of a travel site: where San Francisco has the bay bridge as
> the background for the term archive and the individual pages, then New York
> has the park.
> I couldn't think of any other way to do this since we want to use term's (
> location taxonomy ) instead of building something that essentially recreates
> the taxonomy functionality with term meta.

Taxonomies exist in the template hierarchy. That would work for your
taxonomy archive cases:


Although for background images, your case might be simplified by just
using the appropriate body_class() styles. body_class() generates
tax-taxonomy and term-slug on taxonomy archive pages.

body.tax-location.term-new-york {

body.tax-location.term-san-francisco {

Doing this on individual post pages are harder, since posts can be in
more than one group in a taxonomy (like cats and tags can). For
something like that, you're going to always need some kind of custom
code to determine which term to use to decide what to do.


More information about the wp-hackers mailing list