Dropdown switching subcategories portfolio

The ‘child_of’ argument lets you select subcategories from a parent category, and a you can get the current taxonomy id to pass as the value: <?php $category_id = get_queried_object_id(); $args = array( ‘hide_empty’=>1, ‘depth’=>1, ‘hierarchical’=> 0, ‘show_count’=> 1, ‘taxonomy’=> ‘portfolio-types’, ‘child_of’ => $category_id ); ?> <ul> <?php wp_dropdown_categories( $args ); ?> </ul> So in the … Read more

template structure for CPT not clear

Sorry I was using wrong structure, after looking through a bit more i found out exact difference for CPT and cutom taxonomies. For custom post types the template structure is like:-\ single-{post-type}.php archive-{post-type}.php search.php index.php And for Custom taxonomies, the template structure I found out from here:- Link:-Templates for Custom Post Types and Custom Taxonomies

how to display child terms with parent terms in custom taxonomy?

Have just tweaked your code to achieve what you need. See, if this works for you – $taxonomyName = “age”; $parent_terms = get_terms($taxonomyName, array(‘parent’ => 0, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); echo ‘<ul>’; foreach ($parent_terms as $pterm) { $terms = get_terms($taxonomyName, array(‘parent’ => $pterm->term_id, ‘orderby’ => ‘slug’, ‘hide_empty’ => false)); foreach ($terms as $term) … Read more

How to filter a taxonomy meta field to the ‘single_term_title’ filter hook

Solved the issue by passing the term_name as a parameter to the callback function to the filter. function bn_term_title( $term_name ) { $term_types = get_term_by( ‘name’, $term_name, ‘tax_1’ ); if( $term_types->taxonomy === ‘tax_1’ ) { if( get_locale() === ‘bn_BD’ ) return get_term_meta( $term_types->term_id, ‘tax1_bn’ ); else return $term_name; } $term_categories = get_term_by( ‘name’, $term_name, ‘tax_2’ … Read more

Custom Tax Archive of Parents Only?

I’ve managed to figure this out myself, so if anyone out there needs some help please try the following… Using the get_terms rather than trying to query it directly. <?php $terms = get_terms(‘custom-tax-name’, array(‘hierarchical’ => false)); foreach ($terms as $term) { $term_link = get_term_link( $term ); if ( have_posts() ) : ?> <a href=”https://wordpress.stackexchange.com/questions/199223/<?php echo … Read more