WordPress.org

Ready to get started?Download WordPress

Forums

Hierarchical Custom Taxonomy Permalinks (17 posts)

  1. thatstacey
    Member
    Posted 4 years ago #

    I recently started playing around with the release candidate--which has been awesome so far--including trying to make some custom post types and taxonomies. Everything seems to be working really well except one small organizational issue in my taxonomy archive's permalinks.

    For this project, I've created a custom taxonomy called "type" for my custom post type "discography;" my register_taxonomy() function looks like this:

    register_taxonomy('discotype',array('discography'), array(
        'hierarchical' => true,
        'labels' => $labels,
        'show_ui' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'discography/type' ),
      ));

    The problem I'm having is that I'd like the urls of my individual taxonomy term archives to reflect the hierarchical relationships between terms. Right now, all term archives appear like this:

    http://domain.com/discography/type/term
    http://domain.com/discography/type/child-term

    I'd like them to look like this:

    http://domain.com/discography/type/term
    http://domain.com/discography/type/term/child-term

    Is there something I need to add to my register_taxonomy() function or .htaccess in order to get the links to look the way I want them to?

    I feel like this is one of those problems with an obvious solution that I'm just missing and/or not googling the correct terms. Any direction would be greatly appreciated!

  2. Hotrocket
    Member
    Posted 4 years ago #

  3. thatstacey
    Member
    Posted 4 years ago #

    Thanks for the tip, Hotrocket. I don't think that totally solves the problem, unfortunately. I've been able to add and use my custom taxonomy, the permalinks for the individual term archives just don't look the way I want them to.

    Maybe I'm just misunderstanding the functionality of these taxonomies to begin with?

  4. anabelle
    Member
    Posted 3 years ago #

    Im having this same issue.

    Im using custom taxonomys for geo referencing.

    An my permalinks now are like:

    site.com/map/country
    or
    site.com/map/city

    Where I would actually like them to be:
    site.com/map/country/city/

  5. Rev. Voodoo
    Volunteer Moderator
    Posted 3 years ago #

    currently, the permalinks just don't work that way unfortunately. If yuo do some google searches you can find a few discussions, and there's something in the trac

    I just can't seem to find my links right now

    But for some reason they don't behave like default WP taxonomies with parent/child

  6. Alex Cragg
    Member
    Posted 3 years ago #

    Has anyone got any further with this? I've just come across this problem too.

    I think this is the trac ticket: http://core.trac.wordpress.org/ticket/12659

  7. wownewmedia
    Member
    Posted 3 years ago #

    Hello,

    Yes, I'm having problems with this. I'm not sure what to do with the file in the trac. Anybody got any ideas?

    Many thanks.

  8. AaronCarr
    Member
    Posted 3 years ago #

    I too am having the same problem, has anyone got any further?

  9. ryansigg
    Member
    Posted 3 years ago #

    From the trac ticket it looks like this is getting addressed in 3.1.
    Cross dem fingers...

  10. mefjuu
    Member
    Posted 3 years ago #

    It seems to not working in Wordress RC2. What about you?

  11. AaronCarr
    Member
    Posted 3 years ago #

    Has anybody got this to work yet? ive tried everything on RC2-17330 :-(

  12. Andrew Nacin
    Lead Developer
    Posted 3 years ago #

    It works in 3.1 but you need to opt-in support for it.

    Use the 'hierarchical' => true flag of the 'rewrite' array for the taxonomy.

  13. mefjuu
    Member
    Posted 3 years ago #

    I can't make it to work.
    In Custom Taxonomy plugin option screen I set:

    Hierarchical -> true
    Rewrite -> true

    ... and hierarchical permalinks still don't work. Any ideas?

  14. Mikko Virenius
    WordPress-asiantuntija
    Posted 3 years ago #

    Following settings will work:

    hierarchical => true
    rewrite => array('hierarchical' => true )
  15. crazy_mtx
    Member
    Posted 3 years ago #

    hi !

    I'm getting my custom twentyten theme to work tanks to your suggestions.
    Currently I got it working like this :
    http://site.org/category/subcategory/ in which i see all my custom posts that have been assigned to subcategory.
    What i want to know is if i can make my url point to the custom post and include in the url the cat/subcat it's in... something like http://site.org/category/subcategory/postname because now it sends me to http://site.org/custom_post_type/postname

    P.S. : I have the permalink set to /%category%/%postname%/

    Any ideas ?

  16. e-duplex
    Member
    Posted 3 years ago #

    Hi, crazy_mtx! Perhaps this plugin will be usefull for you: Custom Post Permalinks

  17. broken45
    Member
    Posted 3 years ago #

    Anyone figure this out? It's driving me crazy.

Topic Closed

This topic has been closed to new replies.

About this Topic