WordPress Taxonomies

As I considered how to organize my site, I searched the web for advice.  I came across this wonderful site by Scott Ellis.  On his site I found an article on “A Basic Explanation of WordPress Taxonomies“.  It’s a cool way to categorize my site, so I will try to use taxonomies.  I fully expect my site organization to change, as I’m brand new to this.  If it’s not working, I’ll change it!

My Taxonomies

I plan on having three top level categories on this site:

  • Travel: Trips I am planning or have taken.
  • Technology: Computers and gadgets, including software.
  • Home: Things that happen where I live and work.

For each Category, I’ll define a set of taxonomies.  Taxonomies are just a way to organize the posts.  Within a Category, each post can be described by all the taxonomies assigned to the category.

Within the Travel category, there are three taxonomies: (with example terms)

  • Place: (Santa Fe, Bosque del Apache, Mesa Verde)
  • History: (Spanish Colonial, Native American)
  • Activity: (Birding, Museum Visit, Geocaching)

Within the Technology category there are also three taxonomies: (example terms)

  • Device: (desktop, laptop, cell phone, GPS, modem, scanner, web site)
  • Software: (iPhone app, financial, WordPress)
  • Activity: (blogging, finances, pay bills, networks)

Within the Home category:

  • Place: (Master Bath, garden)
  • Activity: (remodel, gardening)

Seems like there ought to be a third taxonomy applying to Home, but it eludes me right now.

Taxonomy Code

I got the code for implementing taxonomies from a post by Justin Tadlock, “Custom Taxonomies in WordPress 2.8“.  Here’s what I used in my blog:


< ?php add_action( 'init', 'create_my_taxonomies', 0 ); function create_my_taxonomies() { 	register_taxonomy( 'place', 'post', array( 'hierarchical' => false, 'label' => 'Place', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'history', 'post', array( 'hierarchical' => false, 'label' => 'History', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'activity', 'post', array( 'hierarchical' => false, 'label' => 'Activity', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'device', 'post', array( 'hierarchical' => false, 'label' => 'Device', 'query_var' => true, 'rewrite' => true ) );
	register_taxonomy( 'software', 'post', array( 'hierarchical' => false, 'label' => 'Software', 'query_var' => true, 'rewrite' => true ) );
}
?>

(The above is supposed to be a text box with scroll bars. That is exactly what it is when I look at it in the editor. However, when published the scroll bars disappear. I think it is a limitation of WordPress. I’d appreciate some comments from anyone that knows for sure.)

3 thoughts on “WordPress Taxonomies

  1. Pingback: Child WordPress Theme | Digital Adventures UNITED STATES

  2. Pingback: Custom Taxonomy Issues | Digital Adventures UNITED STATES

Leave a Reply to ig Cancel reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>