/ / WordPerson custom taxonomy zobrazuje len 1 post - wordpress, custom-post-type, taxonomy

WordPerson custom taxonomy zobrazuje len 1 post - wordpress, custom-post-type, taxonomy

Mám niekoľko príspevkov v custom taxonomii. Ale keď som si vytvoril dotaz, dostanem len jeden príspevok.

Tu je kód:

<?php
$args = array(
"post_type" => "songs",
"posts_per_page" => -1,
"tax_query" => array(
array(
"taxonomy" => "genre",
"field" => "slug",
"terms" => "jazz",
),
),
"orderby" => "menu_order",
"order" => "DESC",
);
$query = new WP_Query($args);
if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
<div class="contact-item col-lg-4 col-md-4 col-sm-6 col-xs-12">
<div class="holder">
<div class="contact-title">
<h3><?php echo get_the_title(); ?></h3>
</div>
</div>
</div>

Čo môže byť zlé?

odpovede:

0 pre odpoveď č. 1

Problém môže byť v nasledujúcom kóde,

"tax_query" => array(
array(
"taxonomy" => "genre",
"field" => "slug",
"terms" => "jazz",
),
),
"orderby" => "menu_order",

Odstráňte tento kód a skontrolujte, či to funguje. Ak funguje, musíte urobiť niečo s navrhovaným kódom.