I have a few posts in custom taxonomy. But when I loop the query I get only one post to show.
Here’s the code:
<?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>
What could be wrong?
The problem might be in the following code ,
Please remove this code and check if it works. If works then you need to do something with the suggested code.