I need to get all items in a custom taxonomy in custom post type
here is my try:
function gat_all_terms($taxonomy){
$terms = get_terms( $taxonomy, 'orderby=count&hide_empty=0' );
$count = count($terms);
$out ='';
if ( $count > 0 ){
foreach ( $terms as $term ) {
$out .= "<li class='item'> <a href='#'>" . $term->name . "</a></li>";
}
}
return $out;
}
But i cant detect for a custom post type.
If you’re trying to get the terms of a custom post type you can check out the answer here:
https://wordpress.stackexchange.com/questions/14331/get-terms-by-taxonomy-and-post-type
Which you could convert to something simpler like: