How to set parent-child relationship between differents custom post types

Finally I’ve found a working solution. The cartoon-series can be registered as you did but episodes custom post types can not be hirarchical (I think WordPress expects parent content be the same type as child content if the relationship is set using post_parent in wp_posts database table). When registering episodes, the rewrite rule must be … Read more

get_posts assigned to a specific custom taxonomy term, and not the term’s children

In looking at the WP_Tax_Query class in /wp-includes/taxonomy.php, I found that there is a ‘include_children’ option which defaults to true. I modified my original get_posts() call with the following, and it works great: $pages = get_posts(array( ‘post_type’ => ‘page’, ‘numberposts’ => -1, ‘tax_query’ => array( array( ‘taxonomy’ => ‘taxonomy-name’, ‘field’ => ‘term_id’, ‘terms’ => 1, … Read more

The Difference Between Hierarchical and Non-Hierarchical Taxonomies?

The simple answer is that terms in hierarchical taxonomies can have child terms. But what else? ‘hierarchical’=>false When you specify a ‘hierarchical’=>false you get the following type of metabox which is the metabox format WordPress also uses for Post Tags: ‘hierarchical’=>true However when you specify ‘hierarchical’=>true you get the following type of metabox which is … Read more

How to show a hierarchical terms list?

Use wp_list_categories with the ‘taxonomy’ => ‘taxonomy’ argument, it’s built for creating hierarchical category lists but will also support using a custom taxonomy.. Codex Example: Display terms in a custom taxonomy If the list comes back looking flat, it’s possible you just need a little CSS to add padding to the lists, so you can … Read more

How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name

After combining a bunch of pieces of other answers I got it working! So here’s the solution for those of you who are struggling with this too: This post and this one helped me out some, so thanks to those guys. Note, all this code, plus your initial custom post type and taxonomy registration code … Read more