C
C
Casey2021-10-26 19:00:10
WordPress
Casey, 2021-10-26 19:00:10

How to display all posts of a certain taxonomy in WordPress?

Good evening.

My task is to display all posts with a category taxonomy.

After reading the official documentation, I only found the ability to display posts with certain terms in taxonomies:

$query = new WP_Query( array(
  'tax_query' => array(
    array(
      'taxonomy' => 'category',
      'field'    => 'slug',
      'terms'    => 'avto'
    )
  )
) );


In this case, it will display posts with the taxonomy category, and its category avto. Is it possible to display all posts with category regardless of the terms?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Artem Zolin, 2021-10-26
@malevi

Use the post type 'post_type' => 'post' in your request

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question