352 Responses

  1. Dave Kennelly
    Dave Kennelly Published |

    Excellent tutorial, thanks Justin.
    On the wp_tag_cloud example above, is it possible to use more than one taxonomy so the cloud would include people & animals?

    Reply
  2. Andrew
    Andrew Published |

    This is great Justin, thanks. One thing I have been curious about. Does it automatically add multiple taxonomy queries? I.e. mysite.com/people/john/places/canada

    Reply
  3. WordPress Taxonomies - Fun with WordPress
  4. Thomas Scholz
    Thomas Scholz Published |

    Just reading about this stuff makes my head exploding with plugin ideas. :)

    But searching the taxonomy.php I found no way to unregister a taxonomy. How should we write proper uninstall routines?

    Reply
  5. DaveK
    DaveK Published |

    Thanks for the answer Justin, as I thought but just hoping this could be done in 2.8.
    I’d also love to know how you get on with Andrews query. If I could have a taxonomy of something like City Name + 3 Bedrooms + 1 Bathroom automatically generated, I’d be a happy man…

    Reply
  6. John Schultz
    John Schultz Published |

    Justin, great post! I’m intrigued. Could I use a date in the taxonomy?

    For example, I’d like to display a post as an upcoming event posted on x day, but happening on y day, and sort by y.

    I’m guessing this is possible if I code the date as text i.e. 20090506.

    What do you think? Suggestions?

    Reply
  7. WordPress Links for 5/6/09 | Weblog Tools Collection
  8. Chuck Reynolds
    Chuck Reynolds Published |

    This sounds really useful but I’m struggling to find a reason to use it for any projects… perhaps I’m just not getting it all the way yet… I can see how beneficial it is from a dev standpoint however.
    Thanks for the write-up – can’t wait to hear more about it from you

    Reply
  9. Steffen
    Steffen Published |

    yeah! I am so proud of WordPress! This will be our next big feature!

    Reply
  10. Jonathan
    Jonathan Published |

    This is the feature that is going to put wordpress leaps and bounds ahead of any other cms.

    What is also great is — is that taxonomies now take on the same role as tags which means you can create templates for each custom taxonomy…
    e.g
    taxonomy-people
    taxonomy-places
    etc.

    This puts you in control of structure and design and opens up Soooo, many more possibilities.

    Jonathan

    Reply
  11. links for 2009-05-07 | Blog Wolkanca
  12. Domain Development
    Domain Development Published |

    This was an awesome post! I’ve got a project where we’re managing a sidetable of property listings (hacking the business directory plugin). Thanks to you, I’m going to implement the tagging of these using the WP taxonomy framework… sweet!

    Reply
  13. links for 2009-05-07 - Ryan Markel
  14. Bryan Harley
    Bryan Harley Published |

    This is certainly awesome, but until WP does the “cool stuff” for pages, this is pretty useless to my client work.

    Great tutorial, Justin. Thanks!

    Reply
  15. John Myrstad
    John Myrstad Published |

    Justin replying Harley: You can use this stuff now for pages and not wait around to see if it’s implemented in the future.

    Now that`s even more interesting. I hope you too find some time to experiment with taxonomy for pages Justin, and maybe find something interesting to include in your series on page templates.

    John Myrstad

    Reply
  16. WordPress Weekend Resources - May 8, 2009 | Theme Lab
  17. Bryan Harley
    Bryan Harley Published |

    I’m doing development work sure, just not too familiar with the customization of the admin side. How can I add the meta boxes and the new admin page?

    Reply
  18. Ray
    Ray Published |

    Hi Justin,

    I’m not using WP 2.8. But I have used the “Custom Taxonomies” plugin for 2.7.

    Just wondering what would happen in the following scenario:

    Let’s say there is custom taxonomy of say /genre/jazz
    and there is also a category named /jazz.

    What will happen?

    Reply
  19. Jean-Baptiste Jung
    Jean-Baptiste Jung Published |

    Learned exiting new things with your article. Thanks Justin!

    Reply
  20. The Frosty @WPCult
    The Frosty @WPCult Published |

    Wow! This get’s me thinking of some amazing possibilities that might be accomplished with 2.8, but also starts to heart my head for thinking miles outside the box.

    Reply
  21. Many
    Many Published |

    Pretty cool ! Found a new toy to play with ^^

    Reply
  22. Don Spark
    Don Spark Published |

    Woof!

    The hard part about taxonomies is “How do you use them?” and “What are they for?” I have been trying to read this month about “linked data”, semantics and “social media” to understand how to use these newer advances for making my small blogs/websites/social media where I design approaches for users. But, there is either a mass of weak information, highly advanced technical stuff or nothing. I am liking your approach more and more Justin. You nailed simplicity on the fuzzy ideas on taxonomies

    I do not clearly understand the difference between tags and keywords. I understand categories are hierarchal but are they tags? I get categories are a taxonomy. Are keywords, tags, categories and meta-data better understood from the taxonomies point-of-view? Is this semantic web or lacking semantics? Would you call taxonomies linked data? Tim Berners-Lee in a rockin’ recent introductory talks on “Linked Data”
    http://www.ted.com/talks/view/id/484
    referred to the wikipedia page on Berlin’s data navigation box on the right as “linked data”
    http://en.wikipedia.org/wiki/Berlin

    This is important because in engaging “How do you use them?” and “What are they for?”, taxonomies like categories hold great potential for people like me who are organizing complicated content and trying to get it to sit up and bark.

    Reply
  23. Sam
    Sam Published |

    Great post on taxonomies in 2.8. I read Ryan Boren’s post on WordPress 2.3 taxonomy schema features a few months back but at my age I remember little of it. Anyway, what I was trying to figure out then and now: is there a way to support multiple hierarchies within a WordPress taxonomy. In other words, can a term have multiple parents?

    For example: if I have a category for states, and 50 states, and then each state in turn has counties. Or, a variation on Ray’s example above where I have a category for music genre, and then each genre in turn has an origin. In these two examples the terms county and origin need to have multiple parent nodes.

    These are the sort of messy relationships we run into all the time in the real world. If WordPress could handle multiple hierarchies, that would be really powerful.

    Reply
  24.   Theming links round-up by Free WordPress Themes Blog
  25. Battra
    Battra Published |

    Great article! :)

    Am I correct to say there is some overlap between taxonomy and custom field? Suppose I want to classify my book reviews by author and genre. I can create custom taxonomy OR add custom fields, right?

    The only benefit of taxonomy that I can think of is the tag clouds. Other than that, what do you think the main advantages of using taxonomy over custom fields? And when should we use it?

    Reply
  26. Chuck Reynolds
    Chuck Reynolds Published |

    could these new taxonomies be applied to users? thinking about advanced user accounts (with additional fields) and organizing people by one or multiples of categories via certain fields…

    Reply
  27. Battra
    Battra Published |

    Ah, it’s much clearer now! Thanks for going to great lengths to explain this.

    Reply
  28. Johnathan
    Johnathan Published |

    Hey Justin, thanks for the documentation on the new taxonomy stuff. I’ve been waiting for this new UI for taxonomies for a while now, but it falls short of my expectations by not providing a ‘category’ like, hierarchical UI for adding and editing new terms to each taxonomy. The category hierarchy is why people are using them as pseudo taxonomies in the first place, because they are hierarchical and you could see all your options right there in category list.

    Is anyone else looking for that kind of functionality and would be willing to collaborate on building a plugin for it?
    johnathan.andersen [at] gmail.

    Reply
  29. Johnathan
    Johnathan Published |

    Alright, I understand how it exceeds expectations… but when I expected the to behave like categories, I was disappointed when it ended up like tags. (Granted I only found out about the implementation when the beta was released.)

    I think the main benefit of a category-like implementation of custom taxonomies and terms is the elimination of long category lists of multiple parent/child relationships (that often try to do what custome taxonomies could do more easily). Like the current ‘tag format’ implementation, you could keep taxonomies separate, but have the benefit of seeing all of your ‘predefined’ terms for each taxa. Because I work on a lot of WP – CMS sites that are run by teams of editors, it wouldn’t be helpful to the authors to have to remember which terms were ‘allowed’ for each custom taxonomy. And as was said above, because the custom field implementation can be rather wonky, the built in permalink structures and archives of taxonomies is an added bonus.

    Because I can’t build a plugin of my own that adds that particular UI, if anyone would to like work with me on building a taxonomy/category UI plugin, please feel free to contact me.

    Reply
  30. (Anti) Social-Lists 5/24/09 | (Anti) Social Development
  31. Wordpress 2.8 Tips and Tricks
    Wordpress 2.8 Tips and Tricks at |
  32. Omar
    Omar Published |

    Am i right, that the hierarchical custom taxonomy isn’t working yet? When i set ‘hierarchical’ => true, it doesn’t show up..

    But yes, it’s really a nice feature, that i’ve been looking forward to. This is the only thing i envied of drupal (which was able to do custom taxonomy for a while now)..

    Reply
  33. Many
    Many Published |

    Didn’t try it out since it’s crossed my mind just now but I guess it also can be displayed by using your WordPress Template Tag Shortcodes plugin. Just by adding the right argument to [wp_tag_cloud]. Or can’t it be ?

    Reply
  34. Monika
    Monika Published |

    Hi Justin
    thanks for this information :-) and explain it so simple

    it works like a charm in the administration panel but all links are error 404

    permalinks are: post_name id
    category base is default

    rewrite is true is set by the *action*

    what can I do to get them work?

    do you have any ideas?

    thanks

    Monika

    Reply
  35. Monika
    Monika Published |

    oh my dear Justin
    so sorry for this double comment

    it doesn’t work for me with WP 2.8 beta2
    but it works with the latest nightly building

    I will play with this a little and than write an article in German language – credits to you is *deafult* by my articles

    ;-)

    Reply
  36. Paul
    Paul Published |

    Hi Justin, Thanks for posting this excellent information.
    I’m really only just beginning to get my head around this – perhaps you could point me in the right direction?

    I have a site that has 4 different wp installs on separate subdomains.
    All the wp installs are based on the same topic but are different functional areas. e.g. news, interviews, product reviews.

    I’d like to tie the tags from each subdomain together so that they could be referenced from any of the 4 installs. So that if someone was reading the news they could click a tag that referenced interviews on the same topic.

    I hope I’m making sense. If you could point me in the right direction I’d really appreciate it.
    Apologies for the long post.
    Thanks
    Paul

    Reply
  37. amy gail
    amy gail Published |

    Justin this is exactly what I need. Thanks!
    How would we call this as a function in our child theme’s function.php?
    – for instance I want to use the conditional tag if ( in_category( ‘discs’ ) …

    Reply
  38. amy gail
    amy gail Published |

    I was able to make this work thanks to your tutorial on creating custom post templates.
    Thanks again – this is perfect!

    Reply
  39. WordPress 2.8 Resources
    WordPress 2.8 Resources at |
  40. Preparing for version 0.6 of the Hybrid theme
  41. Using custom taxonomies to create a movie database
  42. Donace
    Donace Published |

    Arrived here following a tweet by ‘Yoast’ and I have to say this indeed sounds very cool. I actually was planning on how to implement a more structured backend for one of my newer projects about cars.

    This make it so much easier when picking tags and sub-sorting cats.

    Thanks

    Donace

    Reply
  43. Eric Martin
    Eric Martin Published |

    Sounds like a great feature – thanks for the write-up.

    I do have one question about your code, specifically the create_my_taxonomies() function. If I understand it correctly, the function will run every time the site is loaded and call the register_taxonomy() functions. I would guess that this is only something you’d want to happen once?

    Am I mistaken, or does the register_taxonomy() code deal with ignoring duplicate request? I also wonder what kind of overhead this adds.

    Reply
  44. links for 2009-06-04 - Ogo
    links for 2009-06-04 - Ogo at |
  45. Tech Blog — John Keyes – Linkeyes 5th June 2009
  46. WordPress 2.8 Beta RC1 — WPCandy — WordPress Themes, Plugins, Tips, and Tricks
  47. Haris
    Haris Published |

    WordPress opened the possibilities of adopting it in any kind of system EASILY (put emphasis on easily). With it, the origination of the posts will be better now.

    Apart from that, wordpress has increased competition for Drupal which is another amazing but heavy CMS. Drupal is still a bit easier because you don’t have to add any line of code to bring up meta boxes but I hope that one day WordPress will add an easier way to add meta boxes just like Drupal and Expression Engine.

    Reply
  48. WordPress Watch » Blog Archive » WordPress taxonomies and what to do with them
  49. Paul
    Paul Published |

    Justin,
    I noticed you mentioned (on the Series plugin post) releasing sometime into the future a plugin for 2.8 that can manage custom taxonomies. Do you have a rough timeframe for this?

    Reply
  50. WordPress 2.8 Tips and Tricks Collection | Weblog Tools Collection
  51. Wordpress 2.8 Baker is officially released | Wordpress Guerrilla
  52. z0r
    z0r Published |

    Thanks alot! This will power the magazine-style sites on Wordpress without the annoying custom fields.
    And this tutorial rocks.

    Reply
  53. Satollo
    Satollo Published |

    I wonder if defining the taxonomies in the function.php of a theme is not a wrong choice… It would be better to define them on the “admin” side, not on the “view” side. I’m wrong?

    Reply
  54. Adi
    Adi Published |

    I still confuse what this things for..
    What the difference with common tag??
    Did you mind that this is the categorised tag?

    Reply
  55. Nicolas Mollet
    Nicolas Mollet Published |

    Hello, this is a great tutorial. I am really happy to find more taxonomy functions in WP. Looks more and more like a full-featured CMS.

    I managed to create some taxonomies (tags) with you tutorial but I can’t find how to create more taxonomies (categories).

    I thought this code would work :
    register_taxonomy( ‘rating’, ‘post’, array(‘hierarchical’ => true, ….);
    Why “hierarchical=true” doesn’t create categories ?

    Reply
  56. Nick
    Nick Published |

    Hi Justin!

    Thanks for this inspiring article. I’m now asking myself how I could use these new taxonomies (e.g. people and places) to tag photos (inside galleries).

    Any ideas?

    Reply
  57. Haris
    Haris Published |

    WordPress 2.8 came out at the right time. I have a great use for taxonomies on this real estate site. :)

    Reply
  58. John
    John Published |

    Playin’ around with all this on WP2.8—working great so far. But I wish there was a way to move specific tags to the custom taxonomies, (eg move “africa” tag to the “places” taxonomy). Integration into the edit post listing section would be great too. Plugin developers Go!

    Reply
  59. DjZoNe
    DjZoNe Published |

    “Here’s the problem: No one has been using custom taxonomies.”
    That’s not true at all. There are and there were plugins that help to use the incredible power of custom taxonomies before. I’m using such stuff on my own quotations page, and just finished a magazine, that uses plenty of custom taxonomies :)

    By the way, your article is great :)

    Reply
  60. Here in HP, a Highland Park, New Jersey blog » Upgrade to WordPress 2.8
  61. EasySeo | WordPress 2.8 Tips and Tricks Collection | SEO2Blog
  62. Mutakhirkan WordPress ke Versi 2.8 | Aman
  63. JoeNo1
    JoeNo1 Published |

    Thanks for the post, Justin.

    I have problem to categorize my tags and keep related posts connected in some ways. This feature might be a clue to solve my problem. I need to try it to see how it works. Hope new gadgets coming soon:)

    Reply
  64. 10 Incredibly Useful WordPress 2.8 Tutorials
  65. WordPress 2.8: Features and tips — gunnerpress.com
  66. WordPress 2.8技巧for开发人员 | 互联网的那点事...
  67. Wordpress 2.8 veröffentlicht - mi-lex.de
  68. Nicolas Mollet
    Nicolas Mollet Published |

    I created a ticket “register_taxonomy only for tags, not for categories ?” for a new taxonomy feature
    See http://core.trac.wordpress.org/ticket/10122.

    Thank you Justin for your answer.

    Reply
  69. Wordpress 2.8 And 10 Things That You Should Know Before/After You Upgrade
  70. WordPress2.8自定义分类
    WordPress2.8自定义分类 at |
  71. Mary-Ann Horley
    Mary-Ann Horley Published |

    I’ve got an established blog with a whole load of tags, some of which would be better off as part of a custom taxonomy now it’s available – is there a way of converting them? (I’m OK with going into PHPMyAdmin)

    Reply
  72. Omar
    Omar Published |

    @Mary-Ann Horley: I guess you’d have to 1. get the IDs of the tags you want to reassign (from wp_terms). 2. go to wp_term_taxonomy, search for those IDs and then set ‘taxonomy’ = ” (like ‘places’) for all of them.

    Reply
  73. Theme Playground | Community Roundup: GPL, new sites launched
  74. Pausen.org > Wordpress 2.8
    Pausen.org > Wordpress 2.8 at |
  75. Wordpress 2.8 Custom Taxonomies | The Mighty Mo Website Design and Promotion
  76. WP 2.8 und die neue Freiheit in der Ordnung der Artikel
  77. Alex
    Alex Published |

    Great article, thanks very much for putting me on to something I never knew existed in WP.

    One question…
    How do I use this with conditional tags?

    For example, I was using has_tags() to display certain text on single.php if a post has a certain tag.

    Now I’m using custom taxonomies, this no longer seems to work.

    Anyone know how I would do this?

    Thanks!

    Reply
  78. Anton Borisov
    Anton Borisov Published |

    Hello!

    How can I see all my tags in on taxonomy? Is it possible?

    In this case I won’t need anymore the plugins like Simple tags or WP Existing tags

    Reply
  79. Alex Capes
    Alex Capes Published |

    Justin – Thanks for your reply.

    I’m slightly confused how I would make a custom conditional tag. I’ve looked in wp-includes/category-template.php (ver 2.8) and am none the wiser.

    Could you possibly give me a little guidance as how to create custom conditional tags?

    Thanks in advance.

    Reply
  80. Shane - Inspiring Your Success
    Shane - Inspiring Your Success Published |

    What a great post. I saw this a few months ago but now I have 2.8 and a new (second) website that uses Wordpress.. and I have a great use for it. Thanks!

    Reply
  81. WordPress 2.8 is uit (+Resources) : WordPress Dimensie
  82. Custom Taxonomies in WordPress 2.8
    Custom Taxonomies in WordPress 2.8 at |
  83. WordPress 2.8 Tips and Tricks Collection | Jokefunfun
  84. links for 2009-06-15 - Go Web Young Man
  85. Shane
    Shane Published |

    Justin – Is it possible to style the css using taxonomies? For example:

    post;
    if ( in_category('9') ) {
    include(TEMPLATEPATH . '/single2.php');
    } else {
    include(TEMPLATEPATH . '/single1.php');
    }
    ?>

    That would work for categories. Is it possible to do similar with taxonomies?

    Reply
  86. Marilyn Langfeld
    Marilyn Langfeld Published |

    Thanks for the great introduction, Justin. Question: You focus on non-hierarchical taxonomies. I’m working with a client who wants multiple taxonomies: food, wine, beer, spirits, that are mixed hierarchical and non-hierarchal Wine>color>geo region>appellation>vintner>vintage and who would love a multiple field search. Taxonomy support in 2.8 gets us closer, can she get what wants?

    Reply
  87. WordPress Portable
    WordPress Portable Published |

    Great tutorial Justin! Having the possibility to use custom taxonomies is a lot useful for the kind of “directories” I intend to make with wordpress.

    I am writing to let you and your readers know about a package I’ve assembled to make it very easy to run a wordpress installation in a portable fashion (usb pen or local drive), for testing and development purpouses of course! If you’re interested check it out at http://nunoantunes.com/wordpress-portable

    Hope some of you guys find it useful. Thank you Justin for sharing a lot of knowledge about wordpress.

    Reply
  88. Marcus Hochstadt
    Marcus Hochstadt Published |

    Thanks for the tutorial, Justin!

    What if you’ve got one post per tax, assigned this tax to other posts, display this tax’s URL on the posts that belong to it and want it to link to that single post?

    For example, you’ve got a handful of cities that are located in a certain region. You gave that region a tax and, in turn, tackled that tax onto all cities located in that region. Now you’d like to display that tax’s URL in the sidebar of the cities’ pages in order to link to the region’s page (that is, *without* the tax’s word in the URL; i.e., -> domain.com/region instead of domain.com/regions/region).

    How would you go about doing this? :-)

    Reply
  89. Time Machine» Blog Archive » WordPress 2.8技巧 for 开发人员
  90. WordPress Taxonomies in 2.8 http://justi… « BBX COM
  91. David Williams
    David Williams Published |

    Justin – great breakdown as usual!

    In your Will Smith query_posts example, how would you get all posts filed under ‘People’ using query_posts?

    Reply
  92. Guillermo
    Guillermo Published |

    Excellent article. Thanks Justin.

    Thomas Scholz wrote above:

    I found no way to unregister a taxonomy

    And you answered:

    I could’ve sworn there was an unregister_taxonomy() function, but after taking a second look myself, I didn’t see anything like that. I wonder if it’s all that important though.

    As you point out, there is no unregister_taxonomy, but it is not necessary. Just removing the code in function.php gets rid of the taxonomies. However, is any terms were entered, they remain in the DB.

    If I did use something like 'will-smith', 'showposts' => 10 ) ); ?> in my theme, can I correctly assume that it will keep working even if the register_taxonomy lines of code were removed from functions.php ?

    Reply
  93. Guillermo
    Guillermo Published |

    Sorry, this ” 'will-smith', 'showposts' => 10 ) ); ?>” got cutoff in my previous comment.

    Reply
  94. Sat'
    Sat' Published |

    Hello Justin,

    I’m trying to understand how can I do a sub-taxonomy, and I saw this:
    “hierarchical means whether the taxonomy terms can be in a hierarchy (categories are hierarchical, tags are not). So, we set this to false to behave like tags and to use the new WordPress features.”

    So, if I understand well, a custom taxonomy can be hierarchical, but I don’t understand how to:
    1- use it anyway as a post “tag”
    2- define a sub taxonomy.

    For example, if I work on magazines, I may have several names, and issues.
    Mag1 – Issue 1
    Mag1 – Issue 2
    Mag1 – Issue 3
    Mag2 – Issue 1
    Mag2 – Issue 2
    Mag3
    Mag4 – Issue 1

    but if I do something like that:

    but i don’t what to put in XXXX as it should apply on posts, but be a sub taxonomy of magazine…

    What could be the solution?

    Reply
  95. goalpost.tv
    goalpost.tv Published |

    Justin ,
    am pulling 3 external feeds

    Team Betting information
    Team Shirts for sale
    Team matches upcoming..

    I know tags is the way to pull all together but not sure how to integrate external data to these..

    Any pointers? Data is outside of wp tables…

    Reply
  96. jawe.net » Blog Archiv » Änderungen und Neuerungen in Wordpress 2.8
  97. kucrut
    kucrut Published |

    Great post, as always.

    Is there any way to reorder the list of custom taxonomies in the admin page? (say by the slug or something…)

    Reply
  98. 零食屋 » Blog Archive » WordPress 2.8技巧 for 开发人员
  99. Spamboy
    Spamboy Published |

    @Justin Excellent tutorial — I was able to experiment with this on my local install and it works great. A few questions (as if you haven’t answered enough already):

    1) The WordPress function reference doesn’t explain what the parameter “hierarchical” does. I set this to “true” to see what happens, and it has the effect of hiding that particular custom taxonomy item from the “Posts” menu, but seemingly nothing else. If tags cannot be hierarchical, then what does this parameter do?

    2) You mention to ‘Sat in
    http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28#comment-134923 that “hierarchical taxonomies are outside the scope of this tutorial.” Will you eventually write such a tutorial, or can you point us to a good one?

    3) Using your examples:

    register_taxonomy( 'people', 'post', array( 'hierarchical' => false, 'label' => 'People', 'query_var' => true, 'rewrite' => true ) );

    yoursite.com/people/will-smith

    What can be done to display content when people visit “yoursite.com/people/” (the root of the above example URL)?

    Thanks!

    Reply
  100. Spamboy
    Spamboy Published |

    @Justin One of the largest reasons this post is popular is because there’s not a wealth of information beyond this blog on custom taxonomies. That, and it was well-written and concise. A few followups:

    1 and 2) So even though WordPress doesn’t automatically provide the meta boxes and manage screens, it still supports custom hierarchical taxonomies, correct? Or are the only such taxonomies available are categories delivered out-of-the-box (OOTB)?

    3) Thanks! Right after I posted this, I played around with it and stumbled upon that trick

    Reply
  101. Blogstropolis » Blog Archive » Inrtoduction To Wordpress Taxonomies
  102. probablepossible
    probablepossible Published |

    Thanks for this tutorial.

    I want to delete the posts and categories taxonomies from a set up I am doing right now, and create very specific taxes in their place. I want to delete these two functions from even appearing in the backend, so as not to confuse my authors unduly.

    As you say, post tags and categories com ‘reloaded” is there a way I can unload them?

    Reply
  103. probablepossible
    probablepossible Published |

    meant to say “come preloaded,” sheesh!

    Reply
  104. Jeremy Wright
    Jeremy Wright Published |

    Justin, just playing around with a custom taxonomy for my girlfriend’s site and having some minor issues… I know this isn’t really a support thing, but I’m really hitting my head against a wall trying to figure out what I’ve farked up…

    Feel free to ignore this, but I figure if I don’t ask I’ll just get MORE frustrated, lol.

    Setup a page to list all posts in a taxonomy (in this case beauty): http://geekyhealth.com/beauty/ (ignore the domain, it’s a test blog for doing her new design)

    registered taxonomy:

    add_action( 'init', 'create_my_taxonomies', 0 );
    
    function create_my_taxonomies() {
    	register_taxonomy( 'subjects', 'post', array( 'hierarchical' => false, 'label' => 'Subjects', 'query_var' => true, 'rewrite' => true ) );
    }

    Page just has simple code:

     'Beauty', 'showposts' => 10 ) ); ?>

    To me, this should show all posts with “beauty” as the Subjects… but it shows ALL posts, in like chronological order or something? Kinda weirded out as to why though…

    Reply
  105. Alex
    Alex Published |

    Justin,

    You did not just start a ‘popular post’ – this is an idea who’s time has come and you have ignited the dry timber in a large forest.

    A quick question if you have the time. I have installed the 2.8ish trac of wordpress mu and thus am able to see the custom taxonomy meta boxes.

    What is the best coding practice to use for wordpress mu in functions.php so that custom taxonomies are not registered for every blog and can be targeted specifically to the relevant blog ?

    Alex.

    Reply
  106. Alex
    Alex Published |

    Justin,

    Thanks for the quick response. I had tested it by just dropping the lines into functions.php, thus was activating for every blog in the mu environment. I have created some code in there to register taxonomies based on the blog.

    However, the best idea would be to develop a plugin that can be activated, but more importantly allowing the admin to configure the taxonomies.

    Creating a plugin to add custom taxonomies is a stretch on my technical skills, please let me know if one has been developed. I would expect that the custom taxonomy manager plugin would work on mu with and am happy to test.

    Kind regards,

    Alex.

    Reply
  107. Mitch
    Mitch Published |

    Hi Justin, really interesting article. I’m wondering if you can search for items within a specific taxonomy?

    Basically I am using pages for products on one of my sites and would really like to be able to search my products but nothing else. Would it be possible to have a products taxonomy, and from that a search box where I can search for a specific product?

    Thanks.

    Reply
  108. An33k
    An33k Published |

    This sounds really useful but I’m struggling to find a reason to use it for any projects… perhaps I’m just not getting it all the way yet… I can see how beneficial it is from a dev standpoint however.
    Thanks for the write-up – can’t wait to hear more about it from you

    Reply
  109. 10 Web Development Links for You | FrontEndBook
  110. ts
    ts Published |

    Hi,

    I’m contemplating to change a category based “multiblog” setup to a taxonomy based “multiblog”. There’ll be a mandatory “blog” taxonomy switch on the edit post screen (and possibly on the manage posts screen as well) – so I’m wondering about replicating the current category based URL structure in the setup and I am wondering if it is possible to use other taxonomies than categories in the permalink setup –

    so

    /%category%/%postname%/

    could be replaced by

    /%taxonomy-abc%/%postname/

    Is that supported in the current taxonomy setup? Thanks for a brief reply!

    Reply
  111. Spamboy
    Spamboy Published |

    @An33k Here’s an example of how I plan to use it, if it will help you picture a real-world application.

    On my blog, I have stories that feature various characters and locations. Each of these will now become a custom taxonomy, which allows me to customize tag templates to display character bios, location descriptions, photos, etc. whenever someone visits the custom taxonomy’s tag pages.

    For example, one character is my wife Jenn. Since my taxonomy will be called Characters, her page will reside at http://spamboy.com/characters/jenn. Then, whenever I write a story featuring Jenn, on the Post Edit page will be a Characters box where I can enter her name and have it automatically associate with the custom taxonomy (vs. the generic list of tags).

    Doing this allows me to logically group my tags, then permits me to use the delivered tags (those without a base grouping like “Characters”, etc.) in the future as I see fit without being bound by how I used them for other things like Locations.

    Reply
  112. Ian
    Ian Published |

    Did this make version 2.8 I can’t seem to find any reference to it on the wordpress.org site?

    Sounds ideal.

    Thanks for posting.

    Ian.

    Reply
  113. knat simon
    knat simon Published |

    Hi Justin

    I’ve been reading your guides over and over and over again.

    I can’t find anywhere to get support on this subject so im trying here.

    I keep getting “not found” and a search box when i click on my taxonomies.

    I don’t get any 404 so i must be doing something right but when i click the taxonomy it doesn’t show the posts.

    Can you help me ?

    Reply
  114. knat simon
    knat simon Published |

    Never mind – i found out that it did not work because i had Simple Tags plugin installed.

    So anyone who can not get this to work for days – uninstall that plugin !

    Reply
  115. knat simon
    knat simon Published |

    Sorry i meant the Category Visibility-iPeat Rev

    Disable that plugin if your taxonomies doesn’t work.

    Christ, I’m such a spammer here – sorry bout that !

    Reply
  116. Gary Taylor
    Gary Taylor Published |

    Thanks for the article, Justin. It solves problem (of my own making) which I’d just encountered.

    I’m building a family tree / history web site, and I’d wanted to ‘tag’ people by surname, country of birth and anything else I feel like. I cn do this, but then there’s no way to extract a list (or cloud) of only the surnames, only the countries, etc. So hurrah for custom taxonomies!

    Gary

    Reply
  117. Spamboy
    Spamboy Published |

    @Justin If this tutorial contains information not found in the documentation, would you consider updating the Codex to include it?

    Reply
  118. Shane - Inspiring Your Success
    Shane - Inspiring Your Success Published |

    I have been trying to find ways to link to posts via taxonomies, like you would normally with permalinks and slugs etc.

    http://codex.wordpress.org/Function_Reference/register_taxonomy

    I found that but am not able to put it to any use?

    Reply
  119. ts
    ts Published |

    Justin,

    I think I may use this plugin

    http://kpumuk.info/projects/wordpress-plugins/scategory-permalink/

    as a starting point. The plugin allows the use of a main category (/%scategory%/%category%/) to be added to the URL in front of the standard category. So if I query the custom taxonomy element the post belongs to and add it instead of the main category, the code should work. I think the magic starts here –

    add_rewrite_tag($tag, $pattern, $query)

    http://codex.wordpress.org/Function_Reference/WP_Rewrite

    Still, I need to dig deeper into this, will paged navigation work within custom taxonomies like it works within categories?

    Reply
  120. ts
    ts Published |

    Cool, this actually works –

    using the “Custom Taxonomies Plugin” I have created a custom taxonomy called “blog”, containing four distinct terms. I then modified the scategory-permalink plugin code to query which “blog” the post belongs to and get the according taxonomy slug using this code –

    $blog = wp_get_object_terms( $post->ID, 'blog', 'fields=ids' );
    $blog = $blog[0];
    $blog = get_term ($blog, 'blog');
    $blog = $blog->slug;

    I then pass $blog on to the scategory plugin as main category and can thus use its /%scategory%/ rewrite variable, but it’s probably best to eventually rewrite the relevant parts of that plugin for this purpose.

    Maybe this is helpful for someone also looking to have a taxonomy based main Permalink structure.

    Reply
  121. The Making of a Monsta … WordPress Theme | Jeremy Adam Davis
  122. Egna strukturer i WordPress | Webbigt
  123. Gary
    Gary Published |

    Justin,

    I’m currently using a plugin for taxonomies, actually just beginning to test it. I generally prefer to add features to the child-theme (hybrid based of course) instead of a plugin, if I can. I just prefer to be as plugin light as possible.

    Above, you said “Open your theme’s functions.php file or create a plugin file to work with.” I’m curious to hear what your opinion is. In regards to site performance, is it better to add it to functions.php or use a plugin, in this case?

    Part two of my question is, the plugin is simply giving me easy access to registering the taxonomy. I believe this is true because once I created some taxonomies, I can now add them to an asside via the “tags” widget (which should really be renamed now). If I keep the plugin for now, and opt for the theme inclusion later, I shouldn’t lose any work, correct?

    Reply
  124. New And Comprehensive Wordpress 2.8 Tutorial and Hack Toolbox | Graphic and Web Design Blog - Inspiration, Resources and Tools
  125. WordPress 2.8 “Baker” Released | Swank Web Style Blog
  126. Gary Taylor
    Gary Taylor Published |

    Justin, when I get the site suitable for other people to look at without falling about laughing I’ll post to the WordPress forum. I don’t do things by halves, so I want it to be pretty perfekt before letting it loose.

    Gary

    Reply
  127. David
    David Published |

    This is an awesome tutorial.

    Is there something similar to get_the_term_list but in a way that doesn’t output the results as URLs?

    I would just like the actual term names for a specific taxonomy that are associated with the post.

    Hopefully someone can help out! I’m so close to achieving my desired functionality.

    Reply
  128. David
    David Published |

    Hey Justin, thanks for getting back to me so fast!

    I can’t seem to figure out how to use get_the_terms() properly.

    I tried:

    $values = get_the_terms( $post->ID, ‘location’); echo $values[0]

    But nothing gets echoed in the post even though the particular post does have a term for the location taxonomy.

    I’m probably missing something basic here… See any obvious mistake?

    Reply
  129. Custom Wordpress Taxonomies | Jeff Siarto
  130. chronicfarmer
    chronicfarmer Published |

    On the subject of “hierarchical taxonomies”:

    I think there might be some confusion of terminology here. It seems to me that the “hierarchical taxonomies” that Justin is saying are available since 2.3 are taxonomy values (stored in the wp_X_term_taxonomy:taxonomy field) that apply to categories – it’s the categories that are hierarchical, not the taxonomies.

    Yes, a hierarchical set of categories can use taxonomies, but without a taxonomy hierarchy how would you apply your taxonomy to your hierarchical categories? I think that in most cases you’d end up applying the same taxonomy to all your categories with a single hierarchy (all sharing the same root parent). This is really just using taxonomies as another level of hierarchy, and it might be more straightforward to not use taxonomies for that application and integrate the taxonomy as the root parent of the hierarchy or hierarchies.

    For example, the breed of dog example in the tutorial would benefit from a hierarchy. Many current breeds of dogs are crosses of various older breeds. How might someone implement this example with a truly hierarchical taxonomy, and what would the benefits be vs. non-hierarchical?

    Is it possible to create a hierarchical set of taxonomies and apply them to tags or categories? What is the best approach to achieve different types of functionality? I am seeing various ways to organize things, including this one (to put it in hierarchical terms):

    – Terms
    — Tags
    — Categories
    — Category hierarchy (via the wp_X_term_taxonomy:parent field)

    and this one:

    -Taxonomies
    — Taxonomy hierarchy (als via the wp_X_term_taxonomy:parent field)

    To implement a taxonomy hierarchy (or should it be “taxonomical hierarchy”?) the main hack is that the term_id would be empty or at least meaningless. Or would that be one trick here, to create a taxonomy (text) value that is also a tag/category?

    OK, my mind is spinning on this one. I started out simply wanting to point out the two different concepts of hierarchical taxonomy here, but the possibilities are interesting, albeit complex and possibly confusing. I’m trying to sort out how to implement various features on my wpmu site (not public yet), and this term_taxonomy stuff is right in the middle of it. I’m pretty sure I want to stay away from term_groups, as they seem to be intended for term aliases, but the notion of a hierarchical taxonomy is what I need. I still haven’t figured out the best way to implement it, but this tutorial was very helpful in explaining the wp_X_term_taxonomy:taxonomy field in some detail and context.

    Reply
  131. chronicfarmer
    chronicfarmer Published |

    After spending some time working with this here are some further thoughts on “taxonomy”:

    1) The “custom taxonomy” concept here is one of two actual ways to implement taxonomies in WordPress. Both these mechanisms are implemented in the same set of tables (wp_N_terms, wp_N_term_taxonomy, etc.), and both have different advantages and disadvantages.

    2) “Custom Taxonomy”, as described here, is a string-based (aka character-based or word-based) mechanism with only 2 levels. The parent is a string (or word), and the child is a Tag, which has a numerical ID as well as some strings (or words) as values. This type of taxonomy is useful when you want to lookup a flat (non-hierarchical) set of terms (tags in this case) by string (or word).

    3) “Hierarchical Taxonomy” is a number-based mechanism, with multiple-levels. I say “number-based”, because in the database tables the parent/child relationships are defined by by ID number, not the Term name or slug. This is the older, Category Hierarchy, way of setting up a taxonomy. It is still a taxonomy, by the dictionary definition, in that it classifies a set of items and orders them. But it does not use the “taxonomy” field in the wp_N_term_taxonomy table to implement the hierarchy and taxonomy, thus some potential confusion arises in WordPress because of WordPress’s use of “taxonomy” as a specific database field (VARCHAR, 32 characters) that implements one of the two distinct taxonomy implementations in WordPress.

    4) The concept of mixing these two types of WordPress taxonomies in a single Taxonomy in a WordPress blog seems like a bad idea to me. They are distinct mechanisms and have distinct uses. As I said in my previous post, using the “taxonomy” field (as described in the original tutorial) with hierarchical categories is messier than just implementing that parent value as the root of a category hierarchy.

    Justin can probably translate what I just wrote into something less developer-oriented and more user/blogger friendly. I wanted to further clarify my thoughts about this after my long-winded post at the end of last week. I hope this all makes sense and clarifies things for at least one person out there.

    Reply
  132. links for 2009-06-11
    links for 2009-06-11 at |
  133. Barny
    Barny Published |

    Thank you so much for showing my how to do this, your guide is easy to understand and very well explained.

    Reply
  134. telebrain
    telebrain Published |

    Justin, thank you so much for this taxonomie tutorial. I’ll try to use it in new Projects.

    One Question. Is it possible to make a related toxonimie cloud.
    e.g. when the user choose one tag of a taxonomie i like to show the related tags of other taxonomies by using wp_tag_cloud.

    Reply
  135. Jonathan Alderson
    Jonathan Alderson Published |

    Hmm. Struggling here…

    I’ve implemented custom taxonomies and had some reasonable sucess (trhough permalinks won’t work no matter how many flushes i try, plugins i disable or number of times I reset/save the permalink structure)…

    I’m outputting a list of taxonomy tags at the end of a post, which output as links to /?taxonomy=tag.

    The ‘tag’ page should surely list all posts which share that tag? Is there something I’m missing to achieve this?

    Reply
  136. Zntgrg
    Zntgrg Published |

    Hi, thank you very much for you quick and easy guide to custom taxonomies.

    I’m facing a little problem:
    a) get_the_term_list outputs an URL and i want plain text, i need these values to create automatically a custom link.
    b) Using the_terms() outputs looks like a total mess to me: i have quite basic programming skills and that array it’s way too much for my poor and cheap brain.
    c) for example, i need to retrieve author’s name, “John Doe”, from custom taxonomy “author”: how can i get a simple “John Doe” output in simple plain text?

    Best regards :)

    Reply
  137. Spamboy
    Spamboy Published |

    @Zntgrg Try looking through the core file taxonomy.php — within that file are a bunch of delivered functions which may provide the functionality you need without having to do anything “exotic” like write a custom SQL query.

    Reply
  138. Spamboy
    Spamboy Published |

    Ooops, forgot a reply! :)

    @Jonathan Justin addressed that question of mine above (http://justintadlock.com/archives/2009/05/06/custom-taxonomies-in-wordpress-28#comment-136816). You’ll need to create a page whose slug is the same as your taxonomy slug, then modify it to show the tag cloud (or whatever other content you are seeking to display). I’ve got some code samples, if you need them, as I’m knee-deep in doing this myself.

    Reply
  139. WordPress 2.8技巧 for 开发人员 | 帕兰映像
  140. WordPress: Kategorie-ID ermitteln » wuestenigel.com
  141. Gregos
    Gregos Published |

    Hi Justin, thank you so much for this post, I finally understand what taxonomies are about :)

    Following chronicfarmers’ comment, I would like to know if there is a way to manage categories in WP 2.8 the way it worked before the implementation of taxonomies. I have the exact same problem as this guy : http://wordpress.org/extend/ideas/topic.php?id=2756 and we are not alone facing this big issue with WP.

    WP doesn’t accept duplicate name/slug categories anymore, so how is it possible to use WP as a CMS? I can’t upgrade and if I do, I can’t make a dump of my database because all my posts belong to (multiple) different categories.

    You seem to know a lot about how WP works, so maybe you’ll think of a solution. I don’t want to start over because WP decided to change things that may be fatal for my blog….

    Thanks a lot, any help is welcome, I’m desperate… :P

    Reply
  142. Avaz Ibragimov
    Avaz Ibragimov Published |

    Hey,

    Is it possible to create a unique custom template for each taxonomy and serve this template to its related tags?

    Reply
  143. cracks
    cracks Published |

    i want to love (and to be able to pronounce) “custom taxonomies” but i’m thinking ….

    1) the content within is not searchable via WP search (including Search Everything type plugins)

    2) Google XML Sitemap doesn’t generate anything from CT to help anything in the Google world

    i did read that you can create a page w/ taxonomy slug, but doesn’t that detract from the massive SEO value that tags provide..?

    Reply
  144. Spamboy
    Spamboy Published |

    @cracks:
    1) true, although WordPress is expanding faster than the mundane search capabilities currently available. You should consider submitting this for a fix.

    2) Google isn’t completely ignorant to your custom taxonomy content. Google already recognizes my custom tags — for example, I have a custom taxonomy of “locations” with the tag “bruce-hall” underneath it. Google found it easily: http://spamboy.com/locations/bruce-hall/

    Comment afterwards: the custom Page for the taxonomy slug (ex: “locations”) is to provide something to display when the base taxonomy is being viewed. It doesn’t reduce the SEO value of the tags themselves (ex: “bruce-hall”).

    Reply
  145. cracks
    cracks Published |

    oh i do (heart) WordPress Spamboy; it’s SO, CLOSE to being truly amazing.

    1) i do have a big problem if the search issue can’t be worked around. Google have conditioned us to use search boxes. and where a site search doesn’t actually search all the content, it’s a factor many can’t / won’t compromise.

    ie – go to the fabulous Pop Critics site and use the search box to search for “comedy” (or visit here where i’ve done it for you: http://popcritics.com/movies/?s=comedy). there must be a work-around for this surely..? visitors will only search once or twice and get “no results found” before moving on.

    nb – i am aware that Pop Critics Search box IS a “search for movie” function, but when visitors see “search” and a search box, they don’t read labels.

    Reply
  146. Spamboy
    Spamboy Published |

    @cracks I should have been clearer — WordPress search has always sucked, and has limitations beyond custom taxonomies. Therefore, there’s alot to fix besides just that element. I didn’t say it couldn’t be worked around — in fact, the best workaround is to install a plugin that overrides default search functionality, then personally modify that plugin to accomodate custom taxonomy searches; that way, you are not modify the core WordPress files. The ultimate solution is to submit a ticket to the WordPress team so that the core search functionality addresses that.

    Reply
  147. Lapinlove404
    Lapinlove404 Published |

    Excellent article !

    I now consider implementing Custom taxonomies for one of my site…

    Do you know if there is a link between custom taxonomies and custom fields ?

    My site has posts with custom fields that I’d like to ‘convert’ into custom taxonomy.

    Is there a way to do that other than doing it manually in the admin ?

    Thanks for the great tutorials

    Reply
  148. Shiba » Expand the Edit Category Admin Panel
  149. Building a WordPress Site: Categories, Tags, Pages, and Permalinks – Spamboy
  150. Cracks
    Cracks Published |

    Is there any way (yet) to remove the base level taxonomy from the URL ..?

    So instead of this …..
    popcritics.com/movies/genres/action/

    the URL is …..
    popcritics.com/movies/action/

    Reply
  151. Wordpress the_tags() for custom taxonomies — ShennyG is me ShennyG.com
  152. A Basic Explanation of WordPress Taxonomies | vsellis.com
  153. Recap: WordCamp Birmingham 2009 + Skribit Updates — PaulStamatiou.com
  154. Nick
    Nick Published |

    I am considering using taxonomies to separate tweets that we will be doing on our site. Basically the tweets will be a separate taxonomy since they will be short posts. And for this taxonomy we will use a different theme layout.

    Basically we will be doing a local version of our own twitter for ease of posting, and will use taxonomies such as “tweets” to make this section separate.

    I do have one question, we don’t want these “tweets” to be passed on to our RSS Feed, but will have a separate feed for our Tweet RSS.. would this be possible, and how would we go about this. (I assume a plugin like Advanced Category Exluder would suffice?)

    A second question is, if we use this taxonomy, do we need to choose a category as a default? Since it won’t really be under any category but in a separate taxonomy grouping by itself, will wordpress still subject a “tweet” to the default category?

    I mean, why a post doesn’t necessarily have to have a tag to be posted, when adding this new taxonomy, will wordpress still go the default route and choose a category for me, even if I don’t choose one and go the route of a separate taxonomy (i.e. “tweets”)

    Reply
  155. Flutter vs. Pods: Finding an ‘iPhone’ solution to CMS in WordPress « Off to WordCamp
  156. Bhaskar
    Bhaskar Published |

    Hello Justin,

    I used added code given by you in function.php.Then i created posts with different custom taxanomy tags.Now after I published those posts tags were displayed but when I click on those tags it gives error 404 Not Found. Please help me with the stuff.

    Reply
  157. Cracks
    Cracks Published |

    @Bhaskar

    A simple “function flush” will fix it. Just go into WP Admin > Permalinks > and click “save”.

    It’s a common problem, who’s cause is beyond me. But Justin addresses the workaround himself in another excellent Custom Taxonomy tutorial.

    http://justintadlock.com/archives/2009/06/04/using-custom-taxonomies-to-create-a-movie-database#comment-146721.

    Reply
    1. nick
      nick Published |

      @cracks thank you! i was having issues with a 404 error and your recommendation fixed everything for me!

      i went into permalinks, did not make any changes from my previous settings, but pressed save and all is well in the world.

      Reply
  158. Cracks
    Cracks Published |
    Reply
  159. Daily Digest for October 3rd | Evan Mullins = Circlecube
  160. Tomáš Kapler
    Tomáš Kapler Published |

    one note and one qutestion:

    you can also use taxonomy management using /wp-admin/edit-tags.php?taxonomy=post_tag (replace post_tag with your taxonomy slug)

    question: i hardly need some sollution to have multiple parent categories. The problem is, that it is not possible, because of bug (IMHO) in wp_term_taxonomy, where id is unique, so you can’t define N:N structure.

    I wonder if you know some workaround sollution

    Reply
  161. Paragraphe.org | Ignacio Gondra | Design | For little and middle-sized enterprises , Web Design, Web Development, Information Architecture, Project Consultancy
  162. Tone
    Tone Published |

    Having used quite a few different CMS’s I can say I love Wordpress, however Taxonomy isn’t something new. Drupal probably has the best Taxonomy system in the CMS business. However, due to it’s insane Learning Curve it is just not viable for the average user. Currently, I only use Drupal for Large Custom built sites and I personally use Wordpress for my sites and have recently began looking at is as a CMS.

    Now the question I am arriving at with Wordpress’s new outlook on taxonomy is there the ability to filter results on a “Category” or “Tags” Template. For example, “Lets say you had a site that shows Games, and you wanted to filter the search using Taxonomy to grab only listings that were in two categories”

    Here is what I am saying:

    Category 1 (Parent Taxonomy Term)
    Game System
    – XBox
    – PS3
    – Wii

    Category 2 (Parent Taxonomy Term)
    Type of Game
    – Sports
    – Adventure
    – Fantasy

    Now is it possible to return a “Category Page” that displays only games that are:

    Xbox – Sports Games

    Filtering out the PS3, Wii, Adventure, and Fantasy Games?

    If that is possible then would it be possible to display two loops with different results?

    For example:

    Category 3 (Parent Taxonomy Term)
    – Best
    – Worst

    Then make it show the “Best” Games on top and the “Worst Games” Below?

    I know this is possible with Drupal, but if it’s possible with Wordpress (without the major complexity of Drupal) I would definitely prefer to use Wordpress.

    Thanks,
    Tone

    Reply
  163. Rhys
    Rhys Published |

    I am also eagerly awaiting an answer for Tone’s question. I am currently redeveloping my photography website, and would love to be able to have my images for purchase in a filtering system. Below is a scenario to work with:

    Taxonomy 1: Formats
    Standard, Panoramic, Horizontal, Vertical, Square

    Taxonomy 2: Edition Types
    Limited, Standard, Artistic

    Taxonomy 3: Sale Type
    Wall Art, Stationary, Stock Imagery

    Taxonomy 4: Content
    Landscape, Seascape, Abstract, Still Life, People, Animals, Sky, Water

    Taxonomy 5: Colours
    Green, Orange, Blue

    (the list goes on)

    Here are a few examples of the assignment of these terms.

    Image A.
    (T1) Panoramic, Horizontal
    (T2) Limited
    (T3) Wall Art, Stock Imagery
    (T4) Landscape, Seascape, Sky, Water
    (T5) Blue

    Image B.
    (T1) Square
    (T2) Standard
    (T3) Stationary, Stock Imagery
    (T4) Still Life, Abstract
    (T5) Blue, Green

    Image C.
    (T1) Standard, Horizontal
    (T2) Limited, Artistic
    (T3) Wall Art, Stock Imagery
    (T4) Landscape, Still Life
    (T5) Green, Orange

    Is it possible to query the database from the previous array, thus narrowing the selection as the ‘terms’ are selected? Ideally a list of the selected tags would want to appear in a list with a ‘remove link’ to allow the user to step back and broaden the search again.

    I know this is probably far fetched, but if anyone has any ideas, or could possibly do some custom coding I would be a happy chappy!

    Reply
  164. christophe
    christophe Published |

    Hey Justin,
    Great explanation on how to create custom taxonomy. I created 4 custom ones super easy with tag clouds on the sidebar for each and each post has 4 new fields with each one, but now I have problems displaying the results when I see the result page for one term of one taxonomy. Don’t know if i’m super clear here but basically in my archive.php page:

    ID, 'test-tax', test-tax: ', ', ', '' ); ?>

    That only works for that specific taxonomy. I don’t get it how to just display the title of the taxonomy selected.
    Then same problems to display related posts. It works with tags but can’t find out to make it work with taxonomy.
    And same problem for my breadcrumb that doesn’t show anything.
    If anyone’s got links where I can find answers then I would be more than happy to cheer with you about wordpress as a CMS but for now….i’m a little bit lost;)

    Thanks

    Chris

    Reply
  165. christophe
    christophe Published |

    Just realize the code I pasted didn’t quite work:

    } elseif( is_tax() ) { ?>                
                    ID, 'course', 'Course ', ', ', '' ); ?>
    Reply
  166. Kathy Sautter
    Kathy Sautter Published |

    Sorry if this has already been covered above, but can custom taxonomies be used in WP MU? I’m looking into ways to create a site for a non-profit that allows individual users to create their own campaigns to raise money for the organization. So an individual user could have one or more campaigns. Is this a possible application of custom taxonomies?
    Thanks!

    Reply
  167. Josh @iDTech
    Josh @iDTech Published |

    VERY useful tutorial, easy to understand. I honestly had no idea what taxonomy referred to prior to this article. Does anyone know of any current extensions that handle this sort of thing?

    Reply
  168. Arvin
    Arvin Published |

    Hi justin, i dont know if want to auto description from this section.

    if is category i can put auto description this :

    pls helpme :)

    Reply
  169. Custom Post Types in WordPress | anthony.geek
  170. John
    John Published |

    Justin, great post.

    One thing I can’t seem to wrap my mind around – let’s take your movie database as an example.

    What if that site would be a media site. So, you’d write about movies, but also about. TV shows. In that scenario, many of the taxonomies (think genre, actors, director/producer etc) you defined for movies would also apply to TV.

    How would you organize this without duplicating your existing taxonomies AND while maintaining slugs like “movies/actor/actor1″ and “tv/actor/actor1″

    Any ideas?

    Reply
  171. Rhys
    Rhys Published |

    @john

    This could be accomplished by defining a different post type (getting some love in WP 2.9), but you are still limited to the ‘post’ format. Have a look at http://pods.uproot.us/ , a much better solution imo, one that I am currently working with. Now if you dont need that depth of structure, then reserve your categories (or define a new taxononmy of ‘format’ ), and then tag them that way. create sub pages for ‘movie’ and ‘tv’.

    Reply
  172. Derek
    Derek Published |

    Hi Justin,

    Is there a way to create a tag cloud that is not ordered by name or count. How could I create a tag cloud that is in order by when a member of the taxonomy is added?

    Reply
  173. HERSCH.
    HERSCH. Published |

    hello I have an error:
    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘create_my_taxonomies’ was given in /home/www/xxxxxx/html/wp-includes/plugin.php on line 339
    when I want display the tag cloud with my new taxonomie, there give me this error.
    pls help. I need it.

    Reply
  174. 6 useful Thematic snippets
    6 useful Thematic snippets at |
  175. John
    John Published |

    @Rhys – thanks, I looked at PODS but I think it’s too much for what I am trying to accomplish. It reminds me of Drupal’s CCK and I still wake up in a cold sweat from that one now and then!

    On another note – anyone tried tag clouds for custom taxonomies? I am having a problem that tags for unpublished (scheduled) posts show up in my cloud. Is anyone else seeing this?

    Reply
  176. 12 Lesser Known But Useful WordPress Hacks
  177. links for 2009-11-05 « newdisco
    links for 2009-11-05 « newdisco at |
  178. links for 2009-11-06 » Dubo.cl
    links for 2009-11-06 » Dubo.cl at |
  179. Excerpts and taxonomies for pages in WordPress 2.9
  180. Paul
    Paul Published |

    Hi,

    Im using the code blue revolution theme and tried to add code to my
    functions.php file to create custom taxonomies.

    Im getting a headers already sent error after saving the content. Any suggestions?

    Here is the code:

     false, 'label' => 'Year', 'query_var' => true, 'rewrite' => true ) );
    	register_taxonomy( 'Make', 'post', array( 'hierarchical' => false, 'label' => 'Make', 'query_var' => true, 'rewrite' => true ) );
    	register_taxonomy( 'Model', 'post', array( 'hierarchical' => false, 'label' => 'Model', 'query_var' => true, 'rewrite' => true ) );
    
    }
    ?>

    Thanks.

    Contact information removed. One should never leave personal information in comments.

    Reply
    1. Nicolas
      Nicolas Published |

      You probably have two calls in the funtion.php file. It all has do be within one single opening and closing tag.

      Reply
  181. links for 2009-11-13 | Digital Rehab
    links for 2009-11-13 | Digital Rehab at |
  182. Gooitzen van der Ent
    Gooitzen van der Ent Published |

    Thank you Justin for this excellent write-up, and kudos to the WordPress crew for implementing this. Great new feature. This feature saves me time, and allows me easier programming.

    Just a tip:
    In the the admin backend under ‘screen options’ (at the top right of the admin screen) one can choose to show which tags taxonomy to show in the post edit and write screen. Handy for example if only using custom taxonomies. Saves screen real estate.

    +1 on the custom content types.
    In addition it would be great if custom taxonomies would only show on chosen custom content types. Also it would be great if the custom content types will be able to be searched.

    +1 on the ability to unregister taxonomies.

    Reply
  183. DavaoBase
    DavaoBase Published |

    Hi there.

    I’m trying to make use of taxonomies in my new blog. I’m also running a popular SEO plugin that automatically changes titles and adds meta information (description, keyword) to each post.

    Unfortunately, taxonomies and taxonomy terms do not appear in my meta keywords. Only the category and tag terms appear. Can anyone point me to the right direction?

    Reply
  184. Gooitzen van der Ent
    Gooitzen van der Ent Published |

    This code might be handy for some people. Although it might be that it could/ should be improved. This might not be the correct way to do this.

    I was looking for a way to do this, as ‘get_the_tags’ appears not to work with custom taxonomy in tag.php. It will just get the normal tags. As stated above.

    Based on the function reference ‘get the tags’ in the codex*. In tag.php this will get the custom taxonomy, and then match it against the current tag (so if your on tag url ‘apple’ it will only select ‘apple’ from the get_terms):

    $posttags = get_terms('your_custom_taxonomy_name');
    $tag_title_query = single_tag_title('', false); 
    if ($posttags = $tag_title_query) {
    echo 'succes';
    }

    You might be able to do the ‘your_custom_taxonomy’ with a variable so it chooses the proper custom taxonomy automatically. Haven’t figured that out, yet.

    * Url to codex entry function reference ‘get_the_tags’:
    http://codex.wordpress.org/Function_Reference/get_the_tags

    Original code:

    $posttags = get_the_tags();
    if ($posttags) {
    foreach($posttags as $tag) {
    echo $tag->name . ' '; 
    }
    }
    Reply
  185. Gooitzen van der Ent
    Gooitzen van der Ent Published |

    Link to a piece of code that will automatically show the selected posts data for whatever custom taxonomy term page one is on.

    See: Automatic post title loop in taxonomy.php

    Code is subject to review.

    Reply
  186. trecords
    trecords Published |

    I have got this error :
    /wp-includes/plugin.php on line 339

    :(

    Reply
  187. 10 Tutorials to Take Your WordPress Development Skills to the Next Level
  188. Extensive Wordpress 2.8 Getting Started Guide | tripwire magazine
  189. 10 Tutorials to Take Your WordPress Development Skills to the Next Level | Web Design Byte
  190. Jaume
    Jaume Published |

    Hi Justin!

    I’m building a clasic list of posts and I want to add an extra information to each post on the list, based on displaying the value of one of my three taxonomies.

    How can i code it?

    I’m asking this to you, ‘cos I need the value saved in my BD not a cloud of values.

    BTW I’m using SimpleTaxonomies Plug in.

    Thanks in advance.

    Jaume

    Reply
  191. Jaume
    Jaume Published |

    Hey Justin I have solved my own question as you describe in your post of how to creat a movie database.

    Displaying custom taxonomies in a post
    Simply replacing taxonomy_name in the below code with the unique name of your taxonomy will handle that.

    ID, 'taxonomy_name', 'Taxonomy Label: ', ', ', '' ); ?>?

    Thanks!

    Jaume

    Reply
  192. Josh
    Josh Published |

    I had no idea custom taxonomies was possible. This will definitely change the way I do things with WordPress! I am glad I stumbled across this.

    Reply
  193. Theming links round-up « Temas e Dicas para Wordpress
  194. FAQ» Blog Archive » Custom taxonomies in WordPress 2.8
  195. Advanced Power Tips for WordPress Template Developers: Reloaded - Smashing Magazine
  196. Advanced Power Tips for WordPress Template Developers: Reloaded - Smashing Magazine
  197. Jonathan Downin
    Jonathan Downin Published |

    I have 1000+ posts that have tags including people and topics in my database. I have implemented a “people” custom taxonomy, but is there a streamlined way to move the people-related tags from the general tag pool into the new taxonomy? I would even settle for a mass-edit sort of function similar to that seen in Simple Tags.

    This would save me a LOT of work going through posts 1 by 1. Any input would be highly appreciated. Thank you.

    Reply
  198. Jonathan Downin
    Jonathan Downin Published |

    Also, 1 more thing. When a term is clicked in a custom taxonomy list, the resulting page is a Wordpress “not found” page. I am not sure what the issue is, but I though making a custom taxonomy.php page would fix it, but I can find no templates for a taxonomy.php template. Any help would be MUCH appreciated.

    Reply
  199. Ed Nailor
    Ed Nailor Published |

    Justin,
    I am developing a new website using your awesome Hybrid (News child) theme and wanted to play with taxonomies. The website is about local information, such as real estate, communities, etc. One of the uses I thought would be interesting would be to create a list of related schools using taxonomies. The problem is that when I get the list (figured out how to hook it in to the Hybrid theme) it sends to a list of related posts. That isn’t so bad, but I’d love to also create a category for schools and when I add a post about a school allow that to cross reference communities (the posts about them) that the school services. When I create the taxonomy “schools”, I get a URL like this: http://website.com/schools/school-tag/. When I create a category named “schools”, I get the URL http://website.com/category/schools/. If I use a plugin to remove the term “category” from the URL, the taxonomies don’t display. However, if I create a post under the “schools” category using the same permalink as a tag, the post is overwritten by the new taxonomy, creating a page that lists all posts under the “schools” taxonomy tag.

    Do you see how this is not working as I’d like? My goal is posts that are interconnected so that visitors can find more related information. Would I be better off just going with a “related posts” plugin, or can I use taxonomies to make this work somehow?
    Ed

    Reply
  200. Ed Nailor
    Ed Nailor Published |

    One other idea would be to create a custom taxonomies.php template for each new taxonomy allowing me to add information about the school and then announce a list of communities that are related. However, I am not sure how to do that using the Hybrid theme, particularly the child themes. (Still new to Hybrid, but loving it so far!)

    Reply
  201. Stef Tock
    Stef Tock Published |

    Just a quick note incase it helps anyone else:
    After following Justin’s excellent tutorials and also trying various plug-ins I’ve been trying to get custom taxonomies working for days. I could create the taxonomies themselves ok, and also create various tags or terms within those taxonomies but when clicking on a term to view it’s page (i.e. taxonomy.php) wordpress would always return a 404. Even stranger if a term closely matched a page slug I would be taken to that page! I tried fresh installs, refreshing permalink structures, removing adn re-creating tables in the SQL database, all sorts to try and get taxonomies functioning correctly.

    Late last night I narrowed down the problem to a conflict caused by the Multi-page toolkit plugin. Since I’ve removed that my taxonomies have been behaving as they should. So if you’re getting frustrated by taxonomies producing 404s check your plugins! p.s. thanks for the great tutorials Justin!

    Reply
  202. links for 2009-05-07 « Blog Archive « Ryan Markel
  203. FactorSim » Blog Archive » Wordpress como CMS
  204. Kawika
    Kawika Published |

    I was wondering what WordPress taxonomies were… and then I stumbled on this post. Thanks for explaining it so well! Can’t wait til WordPress implements a feature so that hierarchical taxonomies will also have boxes added to the admin panel automatically!

    Reply
  205. Artiklar för Wordpress tema- eller plugin-kodaren | jenst.se
  206. Babak Fakhamzadeh
    Babak Fakhamzadeh Published |

    This is not working for me in Wordpress 2.9 with the thematic themeset turned on. It works with other themes.

    Reply
  207. Lucius
    Lucius Published |

    One of the best tutorials that i have ever seen. Thanks alot. I am creating a new theme and this post will help me a lot.

    Reply
  208. Ash Blue
    Ash Blue Published |

    This post rocked my socks! Its just what I needed for a new project. Other solutions involved poking around WordPress files that would break everything when a new release came around.

    Reply
  209. Ami
    Ami Published |

    one of the most helpful posts yet – and that is saying a lot because they are all helpful! one question – i was able to create a custom link taxonomy, but now can’t figure out how to list all bookmarks with a specific taxonomy. any ideas are much appreciated!

    Reply
  210. David Abbott
    David Abbott Published |

    Justin – thanks. Really useful.

    One thing I’m struggling with is how to get a list of other posts with the same taxonomy term as the current post. No related post plugin does it without specifying what term you want the related posts to relate to.

    The scenario: I have a custom term ‘Author’ for a site that collects articles by different writers. There are hundreds of authors so I wanted to avoid setting up author-users for each one so turned to taxonomies. When the viewer is looking at an article by a particular author I would like to be able to display a list of other articles by that author without navigating away from that page onto a taxonomy archive page.

    Do you, or does anyone here, know if that is possible?

    Thanks again for the clear guide you have provided

    Reply
  211. Josh
    Josh Published |

    Is there an update on the ability to move taxonomy terms between groups. Seems like several people are looking to do this. I really want to start using custom taxonomies but it seems there are still too many unkowns.

    Reply
  212. Josh
    Josh Published |

    I’m intensely searching for the solution to moving taxonomies and the only thing I can come up with is to get into the database and edit the ‘wp_term_taxonomy’ table. It seems as simple as changing ‘post_tag’ to ‘people’ for example.

    Reply
    1. John
      John Published |

      still waitin’ myself… :(

      Reply
    2. John
      John Published |

      Hey. Ok, I found a sort-of solution using the “Simple Tags” plugin. It doesn’t let you move terms to a custom taxonomy but you can do a blanket search of all your posts and then add your terms to the taxonomy.

      eg: install plugin > go to “mass edit terms” under the posts menu > select your custom taxonomy from the dropdown list at the top of the page > do a quick search > add your terms > click “update all.”

      It’s not exactly ideal, I know, but it’ll get the job done until there’s an actual solution. Good luck /J

      Reply
  213. webdevign » Blog Archive » Wordpress und Taxonomie in Posts
  214. Sobre este blog – Los libros del Tigre
  215. Cracks
    Cracks Published |

    I’ve been using, and loving Custome Taxonomies since Justin published this post. But since upgrading to WP V2.9.1 the is_tax is causing grief (http://core.trac.wordpress.org/ticket/10721#comment:6).

    And since CT’s are my primary navigation system, and I’m using if is_tax for custom page titles and descriptions, I’m a bit screwed.

    Can anyone help?

    Reply
  216. Simon Bailey
    Simon Bailey Published |

    Howdy Justin,

    Great post mate, just wanted to pick your brains if you don’t mind. Soneone posted earlier about a need for event dates, and I have a specific need for a taxonomy related to this and I have no idea how to do it. Wondered if you could help.

    It’s an events section where users can post a new event, where the event is going to be, a description, and when it is occuring.

    My issue is the date.

    I sorted the location with:

    register_taxonomy( 'Location', 'events', array( 'hierarchical' => true, 'label' => __('Location') ) );

    But I have no idea what to do for the date.

    I want to ultimately display the day as a number and the first 3 letters of the month.

    So event will be held on 7 FEB.

    Is there a way I can set up 2 dropdowns, one for the day and one for the month, and set this as a taxonomy in the write panel for users?

    I am quite new to this, hope you can help or possibly point me in the right direction.

    Once again, cheers for a great post.

    Reply
  217. Nathan B
    Nathan B Published |

    Sorry for probably missing something obvious, but what’s the key to getting the description to display for a term in the taxonomy? For a category the hard-coding is:

    <?php if (is_category('Category A')) { ?>
    <p>This is the text to describe category A</p>

    but what’s the equivalent for taxonomies? And for users of the Custom Taxonomies plugin, what’s the non-hard-coded way to get the descriptions you enter in the taxonomy edit panel to display?

    Reply
    1. Nathan B
      Nathan B Published |

      OK, I found it in this other post of Justin’s on custom taxonomies: http://bit.ly/9ldLdc :

      <?php $term = get_term_by( 'slug', get_query_var( 'term' ), get_query_var( 'taxonomy' ) ); echo $term->name; ?>
      <?php echo term_description( '', get_query_var( 'taxonomy' ) ); ?>

      Reply
  218. Wordpress Taxonomies - Digital Adventures
  219. Two Wordpress Blogs on One Domain | Edit and Post
  220. Bhaskar
    Bhaskar Published |

    Hello Justin,

    I have added the following code provided by you in functions.php :

    add_action( ‘init’, ‘create_my_taxonomies’, 0 );

    function create_my_taxonomies() {
    register_taxonomy( ‘people’, ‘post’, array( ‘hierarchical’ => false, ‘label’ => ‘People’, ‘query_var’ => true, ‘rewrite’ => true ) );
    register_taxonomy( ‘places’, ‘post’, array( ‘hierarchical’ => false, ‘label’ => ‘Places’, ‘query_var’ => true, ‘rewrite’ => true ) );
    register_taxonomy( ‘animals’, ‘post’, array( ‘hierarchical’ => false, ‘label’ => ‘Animals’, ‘query_var’ => true, ‘rewrite’ => true ) );
    }

    Then in my index.php file in the loop I added the folllowing code:

    ID, ‘people’, ‘People: ‘, ‘, ‘, ” ); ?>

    Nothing was shown on the front end though in back end I was able to add custom tags. Kindly help me !!!!. I am in urgent need.

    Reply
    1. Bhaskar
      Bhaskar Published |

      Sorry I added
      echo get_the_term_list( $post->ID, ‘people’, ‘People: ‘, ‘, ‘, ” );
      in my index.php

      Kindly help me .

      Reply
  221. Joshua
    Joshua Published |

    I’m trying to use custom taxonomies, have set it up the same way you have. However i get the error :

    Catchable fatal error: Object of class WP_Error could not be converted to string

    Anyone have any idea how i can fix this ?
    thanks

    joshua

    Reply
  222. Looking forward to WordPress 3.0
    Looking forward to WordPress 3.0 at |
  223. brainsolid
    brainsolid Published |

    What i must do for show url like yoursite.com/people/will-smith ?
    I add code ID, ‘people’, ‘People: ‘, ‘, ‘, ” ); ?> in my single.php, but when click on “will-smith” there is 404 error.

    Reply
  224. Amber Taylor
    Amber Taylor Published |

    Hell to the Yeah! Thanks for sharing this…it seems to have been hidden for so long now. This is a total game changer for Wordpress as a CMS :)

    Reply
  225. lee hodgson
    lee hodgson Published |

    great post. i’m just getting started in WP, and already loving it, so keep up the great tutorials.

    I do have one question. I am setting up a music video site, where the videos will be the posts. And my custom taxonomies are:

    genre
    artist
    (record) label
    album

    So for each post (song), I am filling in the genre, artist, label, and album (where appropriate) terms.

    But it seems to me not an optimal data structure. For example, the genre should really be a “property” of the artist i.e. set up once for each artist, not set up for every song …. its just duplicating the information, when it should only be stored once.

    So how would I go about doing that sort of thing, is it even possible in WP2.9? I can see lots of relationships in the information but no real idea how to represent it with the WP custom taxonomy structure / admin interface.

    Any tips welcome.

    Reply
  226. Add Custom Taxonomy Columns to Edit Posts Page
  227. April 15: Taxonomies Are a Wonderful Thing « Portland WordPress User Group
  228. yoni
    yoni Published |

    This is really wonderful, but I have one question: I’ve registered taxonomies, they work really well, but for some reason the rewrite doesn’t work! So if i click on http://mysite.com/mytaxonomy/taxonomyterm (which is autogenerated by the cloud) it brings me to a 404. do you know why that may be?

    Reply
    1. Margarida Fernandes
      Margarida Fernandes Published |

      The same problem is happening to me. Everything works just fine, but when I click a term in my taxonomy cloud, it gives me a 404 error. I have a taxonomy.php template in my theme folder.
      Any help with this?

      Reply
    2. Jen G
      Jen G Published |

      I’m having the exact same problem. Anyone find a solution for this?

      Reply
    3. Jen G
      Jen G Published |

      Found the solution: resave the permalinks.

      Reply
  229. Diana
    Diana Published |

    Justin, great post! I’m amazed! Thanks! I have been using tags all this time.

    Reply
  230. A.
    A. Published |

    great tut, thanks! I’m trying to incorporate it with custom post types, it works quite good besides the url rewriting issue..

    I can get to mysite.com/country/cityA or mysite.com/country/cityB (country is the custom taxonomy) but I can *not* get to mysite.com/country .. it gives a 404. I would like to list all of the cities for this taxonomy but anything I try (using taxonomy.php or taxonomy-country.php or resaving in the permalinks section) doesn’t work..

    Any ideas on that? what would be the equivalent of archive.php that will catch and display it?

    big thanks anyhow!

    Reply
  231. pmdci
    pmdci Published |

    Great tutorial,

    Thanks a lot!

    I have a question, tough. This is quite cool for someone who needs additional taxonomies. However, I think that a similar approach can be used by simply using categories and child categories. This is pretty much what I need in my case.

    since wordpress function to list categories allows you to add/subtract categories, or show only categories which are child of a given parent subcategory, I am pretty sure one could achieve the following example by only using categories. Imagine the following drop-down menus

    CITY
    -> New York
    -> Chicago
    -> Philadelphia

    FLAT
    -> 1 bedroom
    -> 2 bedrooms
    -> 3+ bedrooms

    In this example, have two main categories (CITY and FLAT) and each one has 3 child categories. The idea would be to have two drop-downs for each category. I am sure this is possible.

    However, the category widget for Wordpress is pretty bad (since it doesn’t allow me to pass custom php code for it, such as to remove a specific category), and to do this coding by hand would be a pain…

    any ideas?

    Reply
  232. http://justintadlock.com/archives/2009/0… « Daily Bookmarks of a Web Designer
  233. Post Title « Daily Bookmarks of a Web Designer
  234. WordCamp San Francisco 2010 Impressions | No Diamonds Web Services
  235. Refactor or Retire? ICE and WordPress 3.0 - Idealien Studios
  236. Adam
    Adam Published |

    This is a great blog post – I just spent time reading the entire thing and comments. I am left with two questions though that you can hopefully help with. This is in regards to a project I am preparing to work on. I will be using Wordpress 3 (currently developing using Beta 2) along with the Custom Post Type UI Plugin.

    1. Is there a way to have the same taxonomy appear on two different post types? I am going to be using custom meta boxes for each post type but also want them to share the same taxonomies. Make sense?

    2. Is there any way to have the taxonomy boxes include predefined tags? Ex, have the user just click on the different options under Genre instead of typing them in. I am going to be having multiple authors and do no want any spelling mistakes that could cause problems in the future.

    Thanks again.

    Reply
    1. tex88
      tex88 Published |

      1) I have the same question. So far I have not found a way for different Post/Content Types to share a Taxonomy, other than faking it, but I hope I’m wrong. Let’s assume:
      post type #1 : Articles
      post type #2 : Reports
      (not really) shared taxonomy : Color
      I have a taxonomy “color-articles” with Label “Color”, and another taxonomy “color-reports” also with Label “Color”, so they seem the same in the Admin. Each taxonomy can have Terms “red”, “green”, and “blue”. But they are not actually connected in the database, and the slugs for terms in color-reports become “red-2″. Not ideal.

      2) If you register the taxonomy with ‘hierarchical’ => true, WP will automatically show the terms as checkboxes! (With a scrollbar if the list gets longer than about 10 items.) I learned this today, thanks to Michael Fields (http://wordpress.mfields.org/taxonomy/).

      Reply
    2. tex88
      tex88 Published |

      Answer to your Question 1: I think we actually can SHARE TAXONOMIES among different custom content types. When we register a Taxonomy, we specify a single content type. But when we register a Custom Content Type, we can specify various Taxonomies that it uses (http://codex.wordpress.org/Function_Reference/register_post_type ).

      I had been using a plugin to create my custom content type (Custom Post Type UI), so I didn’t realize there are more things we can specify by doing it manually in functions.php.

      Now my custom taxonomy “Color” appears under both of my content types (Articles, Reports). And the Count for each term includes both content types.

      Thanks to Chris Coyier & Jeff Starr of Digging into WordPress (http://digwp.com/2010/05/guide-new-features-wordpress-3/) for pointing me in the right direction.

      Reply
  237. Greg
    Greg Published |

    Greetings, I looked through the comments and don’t think this is a duplicate.

    I’m upgrading an old site that uses a category based permalink structure, in the admin panel I did a custom structure of: /%category%/%postname%

    I now have more a more meaningful taxonomy of country around which I want to structure my permalinks, for example: /%country%/%postname%

    Any ideas how it’s done?

    Reply
  238. Complete Guide to the Awesome New Features in WordPress 3.0 | Digging into WordPress
  239. Wordrpess as CMS | webdevils.com
    Wordrpess as CMS | webdevils.com at |
  240. Fuller Web Development - Wordpress Events Calendar for RakSa
  241. Rick Adlam
    Rick Adlam Published |

    Great Article Justin. You have a great style of explaining hard to grasp concepts to the average , non technical wordpress user.
    Two things. I notice that you promote the book Digging into WordPress. Why don’t you write a book yourself on WordPress 3.0? I would be your first customer. Most of the books out there are not even close to your ability to explain how to use the power of WordPress. For instance I did not know that custom taxonomies were available since WP 2.8.
    Secondly you asked for scenarios. My use example is of a mortgage comparison site.
    I have an old static site on mortgages that I want to rebuild in WP 3.0. [I have several wordpress blogs]. I want to make it useful for people to self-compare mortgages available, and for them to be able to preview what loans are availble for their situation.
    How would I best use custom posts and taxonomies on this site? [Why did you elect to go for non hierarchal taxonomies.]
    Most people only focus on interest rates.
    Loans however could be classified by, Funder, loan size, down payment, lender, lender type, distribution channel/s, loan type, client type/ employment stability, income and job type/ partners/ downpayment, mortgage insurance [variable on deposit amount] loan purpose, loan costs, Property security, loan size, Interest fixed or variable or combo/ revolving credit line, Repayment options, Loan style, Loan options, Interest rates, Introductory discount offers, Loan terms, Loan conditions, Early repayment options, application fees, establishment fees, ongoing fees and charges, deferred fees, early repayment penalties, default fees and interest rates, default processes, Loan documention type, Credit rating/history/ scores. etc.
    E.g. Client type could be first home buyer, self employed, with less than two years income/tax statements, with minor credit defaults. In Australia he would be paying a higher interest rate than a professional, such as an employed lawyer on $150,000 with clear credit, and be precluded from applying with many lender types. Incomes,dependents and financial commitments can also affect the
    Each one of these can have a multiple choices, and or be dependent on other areas.
    Any suggestions would be appreciated.

    Reply
  242. Wordpress 3.0 Custom Taxonomy
    Wordpress 3.0 Custom Taxonomy at |
  243. Wordpress 3.0 Roundup | Themergency
    Wordpress 3.0 Roundup | Themergency at |
  244. Wordpress 3.0 Now Available For Download | But You're A Girl
  245. links for 2010-06-19 | Bakkel dot com
  246. Errr, guess I shouldn’t have clicked that button | Susan Hated Literature
  247. WordPress 3.0 custom post types, taxonomies & Thesis — kristarella.com
  248. Wordpress 2.8 tricks and hacks | Word-ex-press
  249. An overview on Wordpress 2.8 | Word-ex-press
  250. Updated pagebar v2.58 | elektroelch.net
  251. Travis
    Travis Published |

    @Greg – When you register your taxonomies you give them a ‘rewrite’ parameter. That will be your permalink structure. If you default it to true, it will take the form of the name of the taxonomy.

    Reply
  252. WordPress 3.0—Pre 3.0 and Beyond — Laura Kalbag
  253. タクソノミーについてのメモ – wordpress | MMB
  254. Gregory Cox
    Gregory Cox Published |

    This is so amazing. I’m trying to make ‘custom segmentation’ for menus in particular sections of the site (like ‘corporate solutions’ / ‘SMB’s’ / ‘DIY’ers.

    I think taxonomies just opened up my eyes to the ‘holy crap’ level.

    Reply
  255. Gokul
    Gokul Published |

    Hi ,
    Its great tutorial to create custom-taxonomies, I want to customize design of wp_tag_colud('taxnomy'=>'something');
    How t0 achieve this?
    get_tag_link(); => doesn’t gives links to the custom-taxnomies

    Reply
  256. Ukasiu
    Ukasiu Published |

    Why does it show that there is no such a thing, when I point to http://sportowewadowice.pl/taxonomy_name/taxonomy_object/ ?

    Reply
  257. Using Term Meta | wordHeavy
    Using Term Meta | wordHeavy at |
  258. Steve Taylor
    Steve Taylor Published |

    Justin, I’m just searching around for a way of using query_posts to gets all posts but exclude those with certain custom taxonomy values – like category__not_in. There doesn’t seem to be be anything definitive out there – can you confirm this? A bit disappointing that WP 3 brought in custom taxonomy support without full querying support…

    Reply
  259. New WordPress 2.8 Tips and Tricks Collection - KW
  260. Chief Alchemist
    Chief Alchemist Published |

    Nice. Thanks.

    Maybe you can help? Is there a way to get all values across all taxonomies for a given post? We wanted to break up the tags into groups to make “queries” easier. But we’d also like to just list them with the posts like normal tag. Like the_tags().

    I know we can do it taxonomy by taxonomy but then they would not be in alphabetical order. Maybe there’s a way to get the taxonomy values into an array? I realize that might sound counter intuitive to the use of taxonomies but it does make sense on this end. I’ll spare you the details :)

    Reply
  261. David Gard
    David Gard Published |

    Nice article, very useful. Am using these now in conjunction with custom post types, and also have taxonomies that are not displayed to users. Just wondering if there is a function you know of for adding a term to a taxonomy, say through a line in functions.php?

    Thanks.

    Reply
  262. Dan Gavin
    Dan Gavin Published |

    Jonathon – great article

    I am using this bit of code in a php widget:

    'recipe_tags', 'number' => 45 ) ); ?>

    All works fine and the tags show up in my sidebar… the only problem is that when i click on a tag to filter them. I am redirected to a not found page.

    Note – this is for a custom post type.

    Im a bit stuck here, so any help would be great.

    Thanks!

    Reply
  263. Dan Gavin
    Dan Gavin Published |

    just realized i wrote Jonathon instead of Justin… sorry about that…

    Reply
  264. Nickshor
    Nickshor Published |

    I have a problem with displaying related post by custom taxonomy tags, using shortcode…

    I post it on wp forum, here:
    http://wordpress.org/support/topic/related-posts-by-custom-taxonomy?replies=12#post-1686951

    Anyone can help!?
    Thanks

    Reply
  265. WordPress: Taxonomies Pt 2 - PHP Plug-in get_the_term_list | Chief Alchemist
  266. Igor
    Igor Published |

    That’s great. Do you know, how to set up special order for the terms of custom taxonomy? Thank you!

    Reply
  267. Dasha
    Dasha Published |

    Hello, thanks a lot for the article! Really helpful – wish I found it earlier.

    I’ve got a question: I have a ‘Portfolio’ custom post type with the following registered taxonomies “web”, “print”, “logo”. On my Portfolio page I wanted to group portfolios by thier taxonomies. I’m using get_posts(‘post_type=portfolio&nopaging=true’) to get all the portfolios… but I can’t figure out how I would go on grouping them by their taxonomy.

    I would appreciate any tips!
    Thanks

    Reply
  268. Thomas Szteliga
    Thomas Szteliga Published |

    Great job Justin and thanks for this article! Helped me a lot to understand this powerful feature.

    Is it possible to create a custom taxonomy and allow the user to select only one single term for that taxonomy?

    I’m using custom post types (register_post_type()) and each custom post type has own custom taxonomies, and I want some of them to allow only one term to be selected. Let’s say a custom post of type “desktoppc” will have a custom taxonomy “cpu” and the user should be able to select only one cpu.

    My idea is to use custom taxonomies as some kind of dictionaries and maybe then filling a custom-field dropdown (select/option) with all values/terms of this custom taxonomy…

    But I’m not sure if it’s not reinventing the wheel.

    Peace

    Reply
  269. WordCamp Philly post mortem « Alexandra Kingsley
  270. Our Structure | Building a College Newspaper Website with Wordpress by Dave Chase
  271. ezhil
    ezhil Published |

    hi guys
    iam using custom taxonomies in my site,so i did have seperate templates for displaying them.
    i have created a taxonomy called people and a term called star and also respective template to star (taxonomy-people-star.php) every thing works fine http://sportsstatus.in/dev/people/star/ .
    but when i query some other taxonomy like http://sportsstatus.in/dev/people/star/?sports=tennis to it the template structure changes to the archive format. how to over this.
    i want the original template structure assigned for star(taxonomy-people-star.php) to work.

    Reply
  272. Wordpress custom taxonomies = hyperlocal revenue – SeanBlanda.com -
  273. An ‘Issue’ | Building a College Newspaper Website with Wordpress by Dave Chase
  274. WordCamp Philly post mortem | Alexandra Kingsley
  275. Creating a custom functions plugin for end users
  276. Marika
    Marika Published |

    Please help! :(

    After I added that first piece of code in funtions.php to create a custom taxonomy, the admin panel went completely blank!

    I was able to go back one step in browser history to remove that bit of code. But updating the file doesn’t help, now I’m terrified that I’ve lost everything!!

    Reply
  277. Vatih
    Vatih Published |

    Thanks for this tuts.
    I know if i was late, but this is very useful for beginner like me :D

    Reply
  278. Michael Ha
    Michael Ha Published |

    I’m trying to figure out how to change “Add new tag” to “Add new people”… Any help would be greatly appreciated.

    Reply
  279. Updated pagebar v2.58 | elektroelch.de
  280. Pak Galaxy - Complete Guide to WordPress 3.0 Awesome New Features
  281. kris
    kris Published |

    I am glad I found this article, I was starting to give up on my idea :o Worked with taxonomies before (series-plugin) but never made one myself;

    Quick question tho: If I go to Posts => my-custom-taxonomy in the dashboard I get this error: “Cheatin’ uh?”
    I think it’s a database issue, but what did I do wrong? (testing on wp 3.1.2.)

    Reply
  282. WordPress as a Groupon clone | SeekPHP.com
  283. 100+ Resources for WordPress Theme Developers | E-SEOPRO
  284. WordPress 2.8 “Baker” allows simple way to add taxonomies
  285. Custom columns for custom post types
    Custom columns for custom post types at |
  286. Custom taxonomy to display related posts from different categories
  287. Dustin
    Dustin Published |

    I know this is a couple years old, but it’s still helpful. Thanks.

    Reply
  288. How To Create Custom Taxonomies In WordPress @ @ Webgraphics.netai.netWebgraphics.netai.net
  289. How To Create Custom Taxonomies In WordPress | Web Design Course Brisbane: Next Course Sat 10th Dec 2011
  290. How To Create Custom Taxonomies In WordPress | Creative Web Design Agency
  291. How To Create Custom Taxonomies In WordPress | DigitalMofo
  292. How To Create Custom Taxonomies In WordPress | Top website Designing Company in India
  293. nitin niraj
    nitin niraj Published |

    very nice tutorial thank you very much

    Reply
  294. derek
    derek Published |

    Justin,

    I am using your “How to list a taxonomy’s terms for each post” technique

    ID, 'people', 'People: ', ', ', '' ); ?>

    However I would like to be able to remove a specific taxonomy from the list.

    Specifically, several posts in my custom post type are marked with ‘current’ as a taxonomy.

    When displaying the taxonomy terms for each post, if it is marked as current I do not want current to be displayed in the list.

    I’m thinking of trying to do a string replacement, but I’ve never done that before so I am researching that now.

    Does anyone know how to accomplish this?

    Reply
    1. derek
      derek Published |

      I was able to get a string replacement to work. For anyone who is interested this is what I ended up with:

      echo str_replace('Current','' ,get_the_term_list( $post->ID, 'project-type', '', ' ', '' ));
      Reply
  295. How To Create Custom Taxonomies In WordPress | Smashing WordPress
  296. How to do damn near anything with WordPress – Stephanie Leary
  297. Himanshu
    Himanshu Published |

    I have created some “Custom Taxonomy Fields”. For example, I have created a taxonomy field called “store-image” (image field) and “store-heading” (text field). Since, I am using custom theme, how can I add the custom taxonomy field in my php file. Can you please let me know the php code.

    Your help in this matter will be highly apprecaited.

    Thanks in advance.

    Reply
  298. Taxonomy Term Descriptions & WordPress Archives | kevinleary.net
  299. Reloaded: WordPress Template Developers Advanced Power Tips | WordPress Planet
  300. Preity Bansal
    Preity Bansal Published |

    Hi,

    Thanks for the great tutorial..

    Just wanna ask that if i could get some help from taxanomies in my project.

    I am trying to built a website that has many levels of categorization.

    For example:

    Main Navigation: Papers, Study Material, Projects, Books solution
    Second Navigation: Under papers: Class X, Class XI, Class XII
    Under Study Material: Class X, Class XI, Class XII
    Under Projects: Class X, Class XI, Class XII
    Under Books solution: Class X, Class XI, Class XII

    Now when one goes to papers and class X I have a list of subjects like English, maths, science… and under english test papers year wise.. example test paper 1 2010, test paper 2 2010, test paper 1 2011 and so on..

    This is for every class and every subject..

    I am wondering how can I get posts under this section which meets only the required criteria..

    Doing it through category will lead to generate a lots of categories..
    Can it be done through custom taxonomies and if yes then how?

    Please guide me through this.. I am stuck

    I am working on cbseexamidea.apprisancy.com

    Any help will be appreciated

    Regards
    Preity

    Reply
  301. Marco Bradley
    Marco Bradley Published |

    Thanks for this tutorial. I am new to wordpress and php and this saves me a lot of research.

    Reply
  302. How To Create Custom Taxonomies In WordPress - Goodfav Howto
  303. The big one oh!
    The big one oh! at |
  304. Core plugin dependency is necessary for a better WordPress ecosystem : Post Status
  305. 택소노미 (Taxonomies) | Enjoy Web
  306. Building an Admin System in WordPress With Custom Post Types, Taxonomies and Meta Boxes - White Heat Design
  307. WordPress Initialization | Jeremy's Blog
  308. MARS
    MARS Published |

    Every blog i read about taxonomies uses examples of calling a general taxonomy into the loop, like posts about Cars, Computers, etc. But what if you have a site that needs to call in the specific information about a neighborhood?

    I have a template called Single-neighborhood and i’ve created a custom post type also called single-neighborhood that has 5 custom fields that need their content displayed on the Single Neighborhood template when a new Neighborhood page is created.

    So i create the neighborhood page, apply the single-neighborhood template, call the custom fields into the template file but then i’m stuck. You see i have 27 neighborhoods that will all use the same template and within the single-neighborhood custom post type i have created 27 posts each with a unique title, slug, and ID but i can’t figure out how to query the right content to the right page and i thought taxonomies would be the solution for me but i can’t figure it out. Any help would be great thanks.

    Reply
  309. Tekim
    Tekim Published |

    Great wrking thanks i ned to help how can i upload image to taxonomy artist?

    Reply
  310. How To Create Custom Taxonomies In WordPress | Smashing WordPress
  311. 10 Incredibly Useful WordPress 2.8 Tutorials | CSE BLOG JUST
  312. Studynus
    Studynus Published |

    Excellent tutorial. I did not want tags as they do not server the purpose but was not sure how to use taxonomy. This example was very helpful and some readers asked fantastic questions.

    Reply
  313. WordPress Admin Edit- Custom columns for custom post types | Shimion.com

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.

css.php