Answer the question
In order to leave comments, you need to log in
Exclude taxonomy value output Uncategorized?
Hello, but do not tell me, I brought out a list of taxonomy values, how to clean up what would not be displayed Without a heading?
$taxonomy_name = 'category';
$args = array(
'taxonomy' => $taxonomy_name,
'orderby' => 'id',
'order' => 'ASC',
'hide_empty' => false,
);
$term_query = new WP_Term_Query( $args );
foreach( $term_query->terms as $term ){
?>
<a href="<?php echo $term->slug; ?>">
<span><?php echo $term->name?></span>
</a>
<br>
<?php
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question