Bug- Query display with array
-
Hi,
I am trying to show the query result for a combination of taxonomies:
Category= nature and video-type (my custom taxonomy) = lecture. The posts should be displayed only if both the conditions are satisfied.Here is the code I am using:
<?php $article_count=0; $args = array( 'video-type' => 'lecture', 'category' => 'nature', ); $query = new WP_Query( $args ); $article_count = $query->post_count; if ($article_count) { echo " <ol>"; $posts = $query->posts; foreach ($posts as $post) { echo " <li> <a>".$post->post_title."</a> </li> "; } echo "</ol> "; } ?>
[Please use the code button, NOT blockquote when posting code]The code is somehow displaying all the values that are valid for taxonomy condition video-type = lectures irrespective of category value.
However, for custom taxonomies (checked another one), it seems the condition is working. Can you please let me know if there is some issue or I am doing something wrong?
Also, the list numberingis not apprearing
Thanks!
The topic ‘Bug- Query display with array’ is closed to new replies.