Understanding WordPress Taxonomy Table Relationships

When working with taxonomies in WordPress, it’s helpful to understand the taxonomy database schema. The WordPress database contains three tables for storing taxonomy data:

  • wp_terms – stores all of your taxonomy terms
  • wp_term_taxonomy – defines what taxonomy each term belongs to
  • wp_term_relationships – cross-reference table that joins taxonomy terms with your content

Let’s look at an example database query joining the taxonomy tables. The below query will return all posts with all taxonomy terms assigned to each post:

SELECT wt.name, p.post_title, p.post_date 
FROM wp_terms wt
INNER JOIN wp_term_taxonomy wtt ON wt.term_id = wtt.term_id
INNER JOIN wp_term_relationships wtr ON wtt.term_taxonomy_id = wtr.term_taxonomy_id
INNER JOIN wp_posts p ON wtr.object_id = p.ID
WHERE p.post_type = 'post'

Using joins you can start to understand the relationship between the three taxonomy tables. I’m a visual person, so I created the below graphic to illustrate the taxonomy table relationships.


Taxonomies are an extremely powerful component of WordPress. Understanding the taxonomy database schema can be very helpful when building more complex WordPress websites. If you are interested in learning more about taxonomies in WordPress, check out my Professional WordPress book.

WordPress Theme Showcase Plugin Example

Below is a test of my WordPress Theme Showcase plugin. Below are the three themes I have loaded in my wp-config/themes folder. Each theme thumbnail has a “Preview Theme” link that lets you view the theme on your site. Great way to show off your themes to the public!

Fully compatible with WordPress 2.7 and WordPress MU 2.7


Gillmor Gang and my Identi.ca Twitter Bridge

By StrangeWork.com: Today I joined Steve Gillmor on his IT podcast The Gillmor Gang to talk about my new Identi.ca Twitter Bridge! Also on the show were Marc Canter (Broadband Mechanics), Evan Prodromou (Identi.ca), and Kevin Marks (Google).

Gillmor Gang IT Podcast LogoOn Monday I decided to make the switch to Identi.ca full time, but to do this I needed a way to post messages from Identi.ca to my Twitter account. After searching for a solution that would fit my needs for a bit I decided to just create one, thus the Identi.ca Twitter Bridge was born.

Steve Gillmor registered shortly after the application launched. I didn’t know at the time, but Steve hadn’t updated Twitter in over a month. Now he was sending all of his Identi.ca updates to Twitter. Steve was pretty vocal about his thoughts on the app, which was great. As a developer I always want to hear feedback on applications I build and launch. Having someone at Steve’s level review an application I created was a real treat!

Identi.ca Microblogging LogoI joined in the later half of the show and talked about my application, how it works, and where it is going. I also spoke on some new features that will be implemented, including the option to disable @replies on posts to Twitter. Steve isn’t a fan of this feature (bug as he calls it) and decided to deactivate his account. I respect Steve’s decision, but as a developer I have to give the users some flexibility with options. Not all users are the same, so I have always programmed to please the majority.

Steve also mentioned he is in the early stages of organizing a Microblogging conference and extended an invitation to me! I think a central gathering of techies to help define what Microblogging is and where it needs to go in the future is an excellent idea! I also hope they have developer specific sessions as well, and if so I’ll probably submit to be a panel member of some sort.

My Interview on The Tech Buzz Show

By StrangeWork.com: Yesterday I had the privilege of being interviewed on The Tech Buzz Show, live on Ustream.tv. I had a great time chatting about web development with Steve and Shawn.

The interview is broke up into three parts and runs about 30 minutes long.

Brad Williams Interview part 1

Brad Williams Interview part 2

Brad Williams Interview part 3

WordPress Weekly Live Tonight with Alex King

By StrangeWork.com: After a break last week for the 4th of July, the WordPress Weekly Podcast returns tonight Friday, July 11th at 10PM EST. Alex King will be joining the podcast for an hour long interview with the gang.

Alex King on WordPress Weekly TonightIf you have ever used WordPress in any fashion then you have probably heard of Alex King. He is responsible for some great contributions to the open-source community including being a founding developer of WordPress and some excellent WordPress plugins and themes.

Alex is also the founder of Crowd Favorite, a web development company who specialize in WordPress development and web-based applications.

As the founder of WebDevStudios, my new web development company who also happens to specialize in using open-source technologies, I’m looking forward to asking Alex a few questions to gain from his experience in the industry.

Make sure to join the WordPress Weekly Podcast LIVE tonight at 10pm EST on TalkShoe.com

Asbury Park Chess Fest 2008 – Going for a World Record!

By StrangeWork.com: I’ve been working on a lot of great projects recently. One of those projects has been creating the new Asbury Park Chess Fest 2008 website.

Chess Pieces - King

The great folks at Prevention First, a not-for-profit agency, and the city of Asbury Park New Jersey will be joining together to host Chess Fest 2008 on September 27th. The event is going to try to break a Guinness Book of World Record for most simultaneous chess games. The current record was set in 2006 in Mexico City with 13,500 chess players.

“ChessFest 2008 will be star-studded and attract the world’s finest and most famous chess players. Pre-event chess-related festivities are planned for the week prior to the event and include a movie, a play and much more.”

Chess Fest Social Presence
We are currently working on building a “social presence” for the event. Currently we have launched four social network accounts:

Chess Fest Facebook Group – The obvious first choice. Facebook is becoming the standard for organized groups and events in a social community.

Chess Fest MySpace Group – by far the most annoying site to create an account for. Now have to wait 7 days before being “allowed” to create a group. coming soon I guess…

Chess Fest Ning Social Network – Ning is an awesome site that allows you to create a social network within minutes! Really looking forward to growing this site and getting the discussions going!

Chess Fest Twitter Account – Of course our good, and sometimes bad, friend Twitter is here. Twitter is a great tool to send out short blurbs and news posts for anyone looking for more information on the chess fest.

These four sites will help us spread the word and build a network of enthusiastic chess players! The next phase will include a couple more networks and possibly a social network application or two.

Now I need to study my chess moves so I don’t get hit with a Fool’s mate at the festival!

Have you Bookmarked the SitePoint Reference yet?

By StrangeWork: SitePoint launched a new section a couple months ago which is a must bookmark for all web developers out there. Mash a solid reference book on HTML, CSS, and JavScript and you’ll have the SitePoint Reference.

HTML, CSS, JavaScript ReferenceSitePoint launched the CSS Reference in March of 2008, and just last week launched the HTML beta reference!

These reference sites couldn’t be easier to use and cover languages relatable to all web developers including HTML, CSS, and a soon to launch section on JavaScript. You can either search for specific elements or drill down in the easy to navigate categories.

Reference sites and books are great for developers like myself that know how to program, but need help remembering syntax from time to time. Do yourself a favor now and bookmark this site!