247 responses to “Custom taxonomies in WordPress 2.8”

  1. Dave Kennelly

    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?

  2. Andrew

    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

  3. WordPress Taxonomies - Fun with WordPress

    [...] Justin Tadlock has published an excellent introduction to adding custom taxonomies in WordPress 2.8. It looks like a great feature that will create some excellent new [...]

  4. Thomas Scholz

    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?

  5. DaveK

    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…

  6. John Schultz

    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?

  7. WordPress Links for 5/6/09 | Weblog Tools Collection

    [...] Custom Taxonomies in WordPress 2.8: Justin explains taxonomies to us and gives us a detail rundown on how to create taxonomies and use them effectively in your WordPress blog. Much of this tutorial is based on the yet unreleased WordPress 2.8. (No Ratings Yet)  Loading …   Visited 8 times, 8 so far today [...]

  8. Chuck Reynolds

    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

  9. Steffen

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

  10. Jonathan

    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

  11. links for 2009-05-07 | Blog Wolkanca

    [...] Custom taxonomies in WordPress 2.8 How to easily create, manage, and display custom taxonomies in WordPress. (tags: wordpress wordpress-2.8) [...]

  12. Domain Development

    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!

  13. links for 2009-05-07 - Ryan Markel

    [...] Custom taxonomies in WordPress 2.8 Making custom taxonomies more user-friendly? My interest in WordPress 2.8 just became much, much greater. (tags: wordpress taxonomy blogging) [...]

  14. Bryan Harley

    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!

  15. John Myrstad

    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

  16. WordPress Weekend Resources - May 8, 2009 | Theme Lab

    [...] Custom taxonomies in WordPress 2.8 – Justin Tadlock discusses a new easy-to-use feature that will be introduced in WordPress 2.8 called custom taxonomies, a feature that even average users can take advantage of. It can be incredibly useful if you want to label your posts (or links) with something besides the usual category or tag. [...]

  17. Bryan Harley

    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?

  18. Ray

    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?

  19. Jean-Baptiste Jung

    Learned exiting new things with your article. Thanks Justin!

  20. The Frosty @WPCult

    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.

  21. Many

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

  22. Don Spark

    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.

  23. Sam

    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.

  24.   Theming links round-up by Free WordPress Themes Blog

    [...] Custom taxonomies in WordPress 2.8 [...]

  25. Battra

    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?

  26. Chuck Reynolds

    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…

  27. Battra

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

  28. Johnathan

    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.

  29. Johnathan

    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.

  30. (Anti) Social-Lists 5/24/09 | (Anti) Social Development

    [...] Custom Taxonomies in WordPress 2.8 Well, obviously, WordPress 2.8 is not out yet but information about it is starting to be released. This article is about creating custom taxonomies or groups. Groupings can be created that are specific to your blog and used in a variety of ways. I’m starting to think about ways I could use this feature. [...]

  31. Wordpress 2.8 Tips and Tricks

    [...] Create Custom Taxonomies in Wordpress 2.8 with minimal code [...]

  32. Omar

    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)..

  33. Many

    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 ?

  34. Monika

    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

  35. Monika

    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

    ;-)

  36. Paul

    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

  37. amy gail

    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’ ) …

  38. amy gail

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

  39. WordPress 2.8 Resources

    [...] Tadlock has three posts on WordPress 2.8 already – The Complete Guide to Creating Widgets in 2.8, Custom Taxonomies in WordPress 2.8, and Tag Descriptions in WordPress [...]

  40. Preparing for version 0.6 of the Hybrid theme

    [...] is, don’t worry. I wrote a post on my personal blog recently that covers how you can easily create custom taxonomies in WordPress [...]

  41. Using custom taxonomies to create a movie database

    [...] recently covered how you can easily create taxonomies in WordPress 2.8. To understand the mechanics behind creating and using them, read that [...]

  42. Donace

    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

  43. Eric Martin

    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.

  44. links for 2009-06-04 - Ogo

    [...] Custom taxonomies in WordPress 2.8 "In WordPress 2.8, creating custom taxonomies won’t even be the job of a plugin developer. Average users can make and use any taxonomy they want with a few lines of code. " (tags: blog howto blogs wordpress tutorial php tags tutorials development blogging cms) Posted by Ogo [...]

  45. Tech Blog — John Keyes – Linkeyes 5th June 2009

    [...] to provide up-to-date information and independent advice relating to online payments.Great post on custom taxonomies in WordPress 2.8.The jQuery TOOLS library works well. Those kind Flowplayer folks are providing [...]

  46. WordPress 2.8 Beta RC1 — WPCandy — WordPress Themes, Plugins, Tips, and Tricks

    [...] Custom taxonomies in WordPress 2.8 [...]

  47. Haris

    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.

  48. WordPress Watch » Blog Archive » WordPress taxonomies and what to do with them

    [...] Tadlock has been blogging about the WordPress taxonomy system during the past few months and has now released a plugin called [...]

  49. Paul

    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?

  50. WordPress 2.8 Tips and Tricks Collection | Weblog Tools Collection

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  51. Wordpress 2.8 Baker is officially released | Wordpress Guerrilla

    [...] Custom Taxonomies in Wordpress 2.8 baker [...]

  52. z0r

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

  53. Satollo

    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?

  54. Adi

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

  55. Nicolas Mollet

    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 ?

  56. Nick

    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?

  57. Haris

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

  58. John

    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!

  59. DjZoNe

    “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 :)

  60. Here in HP, a Highland Park, New Jersey blog » Upgrade to WordPress 2.8

    [...] Custom taxonomies in WordPress 2.8 [...]

  61. EasySeo | WordPress 2.8 Tips and Tricks Collection | SEO2Blog

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  62. Mutakhirkan WordPress ke Versi 2.8 | Aman

    [...] Codex – Version 2.8 Custom Taxonomies in WordPress 2.8 – Justin Tadlok Build A WordPress 2.8 Widget – WP Engineer WordPress 2.8 and the body_class() [...]

  63. JoeNo1

    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:)

  64. 10 Incredibly Useful WordPress 2.8 Tutorials

    [...] 4. Custom Taxonomies in WordPress 2.8 – Justin Tadlock [...]

  65. WordPress 2.8: Features and tips — gunnerpress.com

    [...] Custom taxonomies in WordPress 2.8 [...]

  66. WordPress 2.8技巧for开发人员 | 互联网的那点事...

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  67. Wordpress 2.8 veröffentlicht - mi-lex.de

    [...] Erweiterte Untersützung eigener Taxonomien [...]

  68. Nicolas Mollet

    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.

  69. Wordpress 2.8 And 10 Things That You Should Know Before/After You Upgrade

    [...] Custom taxonomies in WordPress 2.8 Submit this to Script & StyleShare this on del.icio.usDigg this!Share this on RedditStumble upon something good? Share it on StumbleUponShare this on TechnoratiShare this on MixxSubmit this to DesignFloatTweet This! Tags: features, upgrade, Wordpress Under: Wordpress [...]

  70. WordPress2.8自定义分类

    [...] 六月 12th, 2009 by Epile 评论文章 » 原文:Custom taxonomies in WordPress 2.8 翻译:Epile [...]

  71. Mary-Ann Horley

    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)

  72. Omar

    @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.

  73. Theme Playground | Community Roundup: GPL, new sites launched

    [...] both of these articles a read: What are “custom taxonomies”? by Joost De Valk and Custom taxonomies in WordPress 2.8 by Justin [...]

  74. Pausen.org > Wordpress 2.8

    [...] Erweiterte Untersützung eigener Taxonomien [...]

  75. Wordpress 2.8 Custom Taxonomies | The Mighty Mo Website Design and Promotion

    [...] of Wednesday, we now have a sweet little hook that will let us make real use of custom taxonomies in our posts. What does this mean? No longer do [...]

  76. WP 2.8 und die neue Freiheit in der Ordnung der Artikel

    [...] Danke Justin [...]

  77. Alex

    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!

  78. Anton Borisov

    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

  79. Alex Capes

    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.

  80. Shane - Inspiring Your Success

    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!

  81. WordPress 2.8 is uit (+Resources) : WordPress Dimensie

    [...] taxonomies zijn als anderen dat al op uitstekende manier hebben gedaan. Zowel Joost de Valk als Justin Tadlock hebben hier uitvoerig over [...]

  82. Custom Taxonomies in WordPress 2.8

    [...] Tadlock has a comprehensive post, Custom taxonomies in WordPress 2.8, that explains the concept very well, and has pretty much everything you need to know. What’s [...]

  83. WordPress 2.8 Tips and Tricks Collection | Jokefunfun

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  84. links for 2009-06-15 - Go Web Young Man

    [...] Custom taxonomies in WordPress 2.8 Custom taxonomies are now native to WP 2.8. This post shows how to use them. (tags: development wordpress taxonomies) [...]

  85. Shane

    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?

  86. Marilyn Langfeld

    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?

  87. WordPress Portable

    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.

  88. Marcus Hochstadt

    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? :-)

  89. Time Machine» Blog Archive » WordPress 2.8技巧 for 开发人员

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  90. WordPress Taxonomies in 2.8 http://justi… « BBX COM
  91. David Williams

    Justin – great breakdown as usual!

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

  92. Guillermo

    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 ?

  93. Guillermo

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

  94. Sat'

    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?

  95. goalpost.tv

    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…

  96. jawe.net » Blog Archiv » Änderungen und Neuerungen in Wordpress 2.8

    [...] Erweiterte Untersützung eigener Taxonomien [...]

  97. kucrut

    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…)

  98. 零食屋 » Blog Archive » WordPress 2.8技巧 for 开发人员

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  99. Spamboy

    @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!

  100. Spamboy

    @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

  101. Blogstropolis » Blog Archive » Inrtoduction To Wordpress Taxonomies

    [...] Are Custom Taxonomies? Wordpress Taxonomy – Wordpress Codex Wordpress Taxonomies Custom Taxonomies in Wordpress 2.8 Simple Taxonomies – [...]

  102. probablepossible

    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?

  103. probablepossible

    meant to say “come preloaded,” sheesh!

  104. Jeremy Wright

    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…

  105. Alex

    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.

  106. Alex

    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.

  107. Mitch

    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.

  108. An33k

    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

  109. 10 Web Development Links for You | FrontEndBook

    [...] complain about the code quality. I think that we are starting to see really good features such as Custom Taxanomies which opens up for very specific solutions built on top of the WordPress [...]

  110. ts

    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!

  111. Spamboy

    @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.

  112. Ian

    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.

  113. knat simon

    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 ?

  114. knat simon

    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 !

  115. knat simon

    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 !

  116. Gary Taylor

    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

  117. Spamboy

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

  118. Shane - Inspiring Your Success

    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?

  119. ts

    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?

  120. ts

    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.

  121. The Making of a Monsta … WordPress Theme | Jeremy Adam Davis

    [...] my posts that are also tagged with ‘blog’. Here’s a few good posts on custom taxonomies: Custom Taxonomies in WordPress 2.8 Using Custom [...]

  122. Egna strukturer i WordPress | Webbigt

    [...] på ett specifikt årtionde. Justin Tadlock har skrivit två bra artiklar angående just detta, en generell om vad taxonomies är och en mer implementations-specifik som visar hur man kan bygga en film-databas med WordPress. Jag [...]

  123. Gary

    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?

  124. New And Comprehensive Wordpress 2.8 Tutorial and Hack Toolbox | Graphic and Web Design Blog - Inspiration, Resources and Tools

    [...] 16.Custom taxonomies in WordPress 2.8 [...]

  125. WordPress 2.8 “Baker” Released | Swank Web Style Blog

    [...] Improvements to custom taxonomies, which you can read more about in detail here. [...]

  126. Gary Taylor

    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

  127. David

    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.

  128. David

    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?

  129. Custom Wordpress Taxonomies | Jeff Siarto

    [...] Cus­tom tax­onomies in Word­press 2.8 Justin Tad­lock explains how to mod­ify your theme’s functions.php file to allow for cus­tom tax­onomies and enabling you to orga­nize con­tent like /​people/​jeff-​​siarto or /​meat/​porterhouse. Thanks to Brad for point­ing this out. [...]

  130. chronicfarmer

    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.

  131. chronicfarmer

    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.

  132. links for 2009-06-11

    [...] Custom taxonomies in WordPress 2.8 (tags: wordpress indexing webdev) [...]

  133. Barny

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

  134. telebrain

    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.

  135. Jonathan Alderson

    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?

  136. Zntgrg

    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 :)

  137. Spamboy

    @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.

  138. Spamboy

    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.

  139. WordPress 2.8技巧 for 开发人员 | 帕兰映像

    [...] Custom Taxonomies in WordPress 2.8 – Justin Tadlok [...]

  140. WordPress: Kategorie-ID ermitteln » wuestenigel.com

    [...] kommt vor, dass in WordPress nicht jede Kategorie auf gleiche Weise dargestellt werden soll. Unterschiedlich viele Posts, [...]

  141. Gregos

    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

  142. Avaz Ibragimov

    Hey,

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

  143. cracks

    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..?

  144. Spamboy

    @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”).

  145. cracks

    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.

  146. Spamboy

    @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.

  147. Lapinlove404

    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

  148. Shiba » Expand the Edit Category Admin Panel

    [...] fields. In the function below, we add a drop-down menu containing all the terms within our Theme custom taxonomy. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 [...]

  149. Building a WordPress Site: Categories, Tags, Pages, and Permalinks – Spamboy

    [...] thanks to their power and flexibility.  Thanks to the information within Justin Tadlock’s excellent tutorials, I’ve shifted to using custom Taxonomies to support my Characters and [...]

  150. Cracks

    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/

  151. Wordpress the_tags() for custom taxonomies — ShennyG is me ShennyG.com

    [...] Custom Taxonomies in Wordpress 2.8 by Justin Tadlock [...]

  152. A Basic Explanation of WordPress Taxonomies | vsellis.com

    [...] Custom Taxonomies in WordPress 2.8 [...]

  153. Recap: WordCamp Birmingham 2009 + Skribit Updates — PaulStamatiou.com

    [...] info about custom taxonomies here or check out this popular plugin (Simple Taxonomies) if you don’t want to touch any [...]

  154. Nick

    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”)

  155. Flutter vs. Pods: Finding an ‘iPhone’ solution to CMS in WordPress « Off to WordCamp

    [...] question if some of the same effects can be achieved through WordPress’ built in ‘custom taxonomy‘ structure. He said keeping data within the post tables takes advantage of lots of features, [...]

  156. Bhaskar

    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.

  157. Cracks

    @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.

  158. Cracks
  159. Daily Digest for October 3rd | Evan Mullins = Circlecube

    [...] Custom taxonomies in WordPress 2.8 This entry was posted in lifestream. Bookmark the permalink. Comments are closed, but you can [...]

  160. Tomáš Kapler

    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

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

    [...] the WordPress fanatics have enjoyed from a very interesting post from Justin [...]

  162. Tone

    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

  163. Rhys

    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!

  164. christophe

    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

  165. christophe

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

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

    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!

  167. Josh @iDTech

    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?

  168. Arvin

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

    if is category i can put auto description this :

    pls helpme :)

  169. Custom Post Types in WordPress | anthony.geek

    [...] up on Justin Tadlock’s tutorial on how to use custom taxonomies. I won’t go into adding taxonomies into the database and [...]

  170. John

    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?

  171. Rhys

    @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’.

  172. Derek

    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?

  173. HERSCH.

    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.

  174. 6 useful Thematic snippets

    [...] Cus­tom tax­onom­ies? What’s that? [...]

  175. John

    @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?

  176. 12 Lesser Known But Useful WordPress Hacks

    [...] which you can add values for custom taxonomies. Justin Tadlock has written complete tutorial on how to create and use custom taxonomies, refer to it for [...]

  177. links for 2009-11-05 « newdisco

    [...] Custom taxonomies in WordPress 2.8 Excelente link con el gentil auspicio de @dbasulto. Taxonomias personalizadas en WP (tags: taxonomies taxonomy wordpress howto hack functions) [...]

  178. links for 2009-11-06 » Dubo.cl

    [...] Custom taxonomies in WordPress 2.8 Excelente link con el gentil auspicio de @dbasulto. Taxonomias personalizadas en WP (tags: taxonomies taxonomy wordpress howto hack functions) [...]

  179. Excerpts and taxonomies for pages in WordPress 2.9

    [...] This one will be a bit trickier. I’ll have to assume you’ve created a custom taxonomy specifically for pages. If you’re unfamiliar with this process, you need to familiarize yourself with creating custom taxonomies. [...]

  180. Paul

    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.

    1. Nicolas

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

  181. links for 2009-11-13 | Digital Rehab

    [...] Custom taxonomies in WordPress 2.8 (tags: tutorial howto taxonomies tags development wordpress) [...]

  182. Gooitzen van der Ent

    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.

  183. DavaoBase

    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?

  184. Gooitzen van der Ent

    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 . ' ';
    }
    }
  185. Gooitzen van der Ent

    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.

  186. trecords

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

    :(

  187. 10 Tutorials to Take Your WordPress Development Skills to the Next Level

    [...] Custom taxonomies in WordPress are similar to tags and categories, but they provide almost endless possibilities. In this tutorial Justin Tadlock shows a practical use for custom taxonomies while working on a movie database website. He shows how to set up custom taxonomies for actor, director, genre, producer, studio, and writer. This will make it easier for visitors to navigate the site as they can click on the actors name and see all of his/her movies. Justin also wrote an introductory post to Custom Taxonomies in WordPress 2.8. [...]

  188. Extensive Wordpress 2.8 Getting Started Guide | tripwire magazine

    [...] the rest by adding the meta boxes on the write post page and new admin menus for managing them. Read more here and learn how to create your own custom [...]

  189. 10 Tutorials to Take Your WordPress Development Skills to the Next Level | Web Design Byte

    [...] Custom taxonomies in WordPress are similar to tags and categories, but they provide almost endless possibilities. In this tutorial Justin Tadlock shows a practical use for custom taxonomies while working on a movie database website. He shows how to set up custom taxonomies for actor, director, genre, producer, studio, and writer. This will make it easier for visitors to navigate the site as they can click on the actors name and see all of his/her movies. Justin also wrote an introductory post to Custom Taxonomies in WordPress 2.8. [...]

  190. Jaume

    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

  191. Jaume

    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

  192. Josh

    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.

  193. Theming links round-up « Temas e Dicas para Wordpress

    [...] Custom taxonomies in WordPress 2.8 [...]

  194. FAQ» Blog Archive » Custom taxonomies in WordPress 2.8

    [...] 引用元: Custom taxonomies in WordPress 2.8. [...]

  195. Advanced Power Tips for WordPress Template Developers: Reloaded - Smashing Magazine

    [...] and “index” template files.Further Reading on Custom Meta Boxes and TaxonomiesJustin Tadlock on Custom Taxonomies in WordPress 2.8Shiba combines meta box and custom taxonomy capabilities in a tutorial Jacob GoldmanJacob M (Jake) [...]

  196. Advanced Power Tips for WordPress Template Developers: Reloaded - Smashing Magazine

    [...] and “index” template files.Further Reading on Custom Meta Boxes and TaxonomiesJustin Tadlock on Custom Taxonomies in WordPress 2.8Shiba combines meta box and custom taxonomy capabilities in a tutorial Jacob GoldmanJacob M (Jake) [...]

  197. Jonathan Downin

    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.

  198. Jonathan Downin

    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.

  199. Ed Nailor

    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

  200. Ed Nailor

    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!)

  201. Stef Tock

    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!

  202. links for 2009-05-07 « Blog Archive « Ryan Markel

    [...] Custom taxonomies in WordPress 2.8 Making custom taxonomies more user-friendly? My interest in WordPress 2.8 just became much, much greater. (tags: wordpress taxonomy blogging) [...]

  203. FactorSim » Blog Archive » Wordpress como CMS

    [...] de un plugin para taxonomías. Para ello, nos hemos basado en el excelente tutorial de Justin, y (2), dónde se explica cómo explotar las posibilidades de las etiquetas avanzadas en [...]

  204. Kawika

    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!

  205. Artiklar för Wordpress tema- eller plugin-kodaren | jenst.se

    [...] Custom Taxonomies [...]

  206. Babak Fakhamzadeh

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

  207. Lucius

    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.

  208. Ash Blue

    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.

  209. Ami

    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!

  210. David Abbott

    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

  211. Josh

    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.

  212. Josh

    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.

    1. John

      still waitin’ myself… :(

    2. John

      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

  213. webdevign » Blog Archive » Wordpress und Taxonomie in Posts

    [...] genau man die Taxonomie einrichten und dann auch benutzt, kann man hier anhand von Beispielen sehen. Leider  funktionieren die Taxonomien bisher nur in Verbindung mit den [...]

  214. Sobre este blog – Los libros del Tigre

    [...] blog está destinado a realizar pruebas y experimentos sobre el concepto de taxonomías personalizadas de WordPress. No debe considerarse, pues, como un blog de carácter educativo, ni siquiera como una [...]

  215. Cracks

    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?

  216. Simon Bailey

    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.

  217. Nathan B

    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?

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 (e.g., 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.