Get custom category name from ID

See the inline comments. Not tested. The following code will grab all the Custom Taxonomy Terms of Custom Taxonomy ‘product-cat’ and will show them one by one from the result array. <?php global $post; $postID = $post->ID //get/put your post ID here $getProductCat = get_the_terms( $postID, ‘product-cat’ ); //as it’s returning an array foreach ( … Read more

Make Custom Taxonomy Category Use Parent Template

Hook into template_include filter add_filter(‘template_include’, ‘research_term_template’); function research_term_template( $template ) { if ( is_tax(‘classifications’) ) { $parent = get_term_by(‘slug’, ‘oldresearch’, ‘classifications’); // to improve performance you can hardcoding ‘oldresearch’ term id // $parent = 12; if ( term_is_ancestor_of( $parent, get_queried_object(), ‘classifications’ ) ) return get_template_directory() . ‘/taxonomy-Classifications-oldresearch.php’; } return $template; }

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

When you create permalink structures like /article/%category%/%postname%/, it becomes very complicated when %category% is hierarchical. The problem WordPress runs into is knowing if after the second slash, the next part of the URL is a category or a post. For instance, in the url /article/parent/child/, is “child” a subcategory of “parent”, or is it a … Read more