List sub-taxonomies from current taxonomy

This may help you: <?php //first get the current term $current_term = get_term_by( ‘slug’, get_query_var( ‘term’ ), get_query_var( ‘taxonomy’ ) ); //then set the args for wp_list_categories $args = array( ‘child_of’ => $current_term->term_id, ‘taxonomy’ => $current_term->taxonomy, ‘hide_empty’ => 0, ‘hierarchical’ => true, ‘depth’ => 1, ‘title_li’ => ” ); wp_list_categories( $args ); ?> Source – … Read more

Group Custom post type in a taxonomy page by its child taxomony

I got it! Seems a little confused at first, but the logic is here: <?php $term = get_queried_object(); ?> <?php echo $term->name; ?> <?php $children = get_terms( $term->taxonomy, array( ‘parent’ => $term->term_id, ‘hide_empty’ => false ) ); if($children) { foreach ( $children as $child ) { ?> <?php echo ‘<li>’ . $child->name . ‘</li>’; ?> … Read more

Echo taxonomy name – second level

You can use that code to retrieve the last taxonomy term in your taxonomy list: in your functions.php file create a custom function: function my_custom_function() { global $post; $terms = get_the_terms( $post->ID, ‘location’ ); if (!empty($terms)) { foreach($terms as $term) { if (!get_term_children($term->term_id, ‘location’)) { echo $term->name; } } } } When, inside your archive.php … Read more