register_taxonomy() (6 posts)

  1. d910qf
    Posted 8 years ago #

    Has anyone used this function?

    I am interested in creating a new taxonomy (extra to tags and categories) and can't seem to find out how to do this or if it is possible.

    For example I would like to keep the tags taxonomy as a user inputted field and then create an autotags taxonomy that is entirely seperate (and is accessable at http://www.example.com/autotags).


  2. d910qf
    Posted 7 years ago #

    This is actually pretty simple once you know how...

    Just use register_taxonomy( 'people', 'post', array('rewrite' => array('slug'=>'people')));

    In your templates functions.php to make the template aware of the taxonomy. Then you can use all the taxonomy functions to add/remove/associate posts to terms in the taxonomy (you'll need to look at wp-includes/taxonomy.php.

    Then if you want to use url variables to do something you have the url http://www.blog.com/people/person and can access the 'person' by using


    This allows you to have any number of http://www.blog.com/taxonomy/term type situations.

    Still looking at how to use similar functionality of tags (tag+tag etc) without rewriting all the functions. Still think this should be in wordpress by default - drupal does it really well.

  3. Konpyuuta
    Posted 7 years ago #


    I was actively searching for a solution to my case, and finally heard about "Taxonomy" thing.
    As I'm not a programmer ... but with some knowledge about HTML (maybe it would help -.-°), could be please help in how to use those?

    Your example of "( 'X', 'post', array('rewrite' => array('slug'=>'X')));" and "get_query_var('X')" insn't that clear for me.
    Is there anyway you give a clearer example? Or maybe a little tutorial?

    That would be awesome, thank you in advance.

  4. MartyThornley
    Posted 7 years ago #

  5. Justin Tadlock
    WordPress God
    Posted 7 years ago #

    @MartyThornley - Yep, that should help.

    Here's my other article on this:

  6. MartyThornley
    Posted 7 years ago #

    These both sounded great, but it isn't working. I have copied them exactly into my functions.php, but the new taxonomies don't show up anywhere.

Topic Closed

This topic has been closed to new replies.

About this Topic