B
B
Bogdan2018-08-28 13:22:19
WordPress
Bogdan, 2018-08-28 13:22:19

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
}

Here is what it outputs now
5b8522582cb5d940171293.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2018-08-28
@bogdan_uman

Try adding where "1" is the category ID "Uncategorized" 'exclude' => 1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question