How can I get WordPress custom taxonomy or category parent terms only
You can set parent as 0 to query WordPress custom taxonomy or category with parent terms only
//Before WordPress 4.5 $terms = get_terms( 'taxonomy_name', array( 'parent' => 0 ) ); //Since WordPress 4.5 $terms = get_terms( array( 'taxonomy' => 'taxonomy_name', 'parent' => 0 ) );