Custom post type AND custom taxonomy are not connected
when registering the post type , try ‘exclude_from_search’ => false,
when registering the post type , try ‘exclude_from_search’ => false,
You can use get_queried_object to return the full queried term object on a taxonomy archive page. $term = get_queried_object(); if( 0 === $term->parent ){ // term is top level } else { // term has parent }
Get archive of posts separated by taxonomies and subtaxonomies
After reviewing the code more & more I found the solution. So, for those who have interest in such thing: change false to true in use_with_theme change template path to stylesheet path in tax-meta-class.php Cheers
It’s hard to understand how you use your taxonomy and where you want to display it. Does your posts have a custom taxonomy and you want to display it there? Or you have some page, like /issues/, with a list of posts that linked to a certain issue number and grouped some how? So, if … Read more
You can create a taxonomy-models_categories.php file in your theme to use as a general template for displaying the posts (‘models’ in your case) of any selected term (‘model category’ in your case). Now, if you wanted to display a different template for a specific term you could create a taxonomy-models_categories-termslug.php template, replacing ‘termslug’ with the … Read more
I found my answer from another site after hours of searching! – http://wpquestions.com/question/showChrono/id/10819 <?php // List posts by the terms for a custom taxonomy of any post type $post_type=”product”; $tax = ‘products’; $tax_args = array( ‘order’ => ‘DESC’, ‘parent’ => 0 ); // get all the first level terms only $tax_terms = get_terms( $tax, $tax_args … Read more
You don’t need multiple taxonomies if all you want to do is customize the order in which they are rendered. A plugin like one of these can help your order your categories, tags and taxonomies: https://wordpress.org/plugins/taxonomy-terms-order/ https://wordpress.org/plugins/custom-taxonomy-order-ne/ Is there something more specific you are trying to achieve?
pealo86 reports that this issue has been resolved thanks to Pieter Goosen’s suggestion in the comments to re-save permalinks. Are you using your index.php as a taxonomy page? If so, it should work if you do not have a taxonomy or archive template in your theme. Just another question, have you re-saved your permalinks?
You can use get_ancestors() to get an array of parents, which you can then count. $term_id = 42; $ancestors = get_ancestors( $term_id, ‘category’ ); if( ! empty( $ancestors ) ){ echo count( $ancestors ); }