Created
September 7, 2012 17:49
-
-
Save astockwell-ps/3668137 to your computer and use it in GitHub Desktop.
PHP: Setup WP Custom Taxonomy with hierarchical URLs (tld/parent_term/child_term/...)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// via http://wordpress.stackexchange.com/questions/17325/how-to-enable-hierarchical-permalinks-for-hierarchical-taxonomies | |
// and http://wordpress.org/support/topic/hierarchical-custom-taxonomy-permalinks | |
register_taxonomy('genre',array('book'), array( | |
'hierarchical' => true, // this makes it hierarchical in the UI | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'hierarchical' => true ), // this makes hierarchical URLs | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment