Title: Bug- Query display with array
Last modified: August 21, 2016

---

# Bug- Query display with array

 *  Resolved [raj137](https://wordpress.org/support/users/raj137/)
 * (@raj137)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/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 numbering
 *  is not apprearing
    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [Ipstenu (Mika Epstein)](https://wordpress.org/support/users/ipstenu/)
 * (@ipstenu)
 * 🏳️‍🌈 Advisor and Activist
 * [12 years, 9 months ago](https://wordpress.org/support/topic/bug-query-display-with-array/#post-4038741)
 * Two things.
 * 1) Are you sure this is a multisite specific issue?
 * 2) Can you repost your code, in the CODE tags please? Or put it on pastebin or
   gist, so we can actually see it? When you post without code tags, things get 
   eaten by the server.
 *  Thread Starter [raj137](https://wordpress.org/support/users/raj137/)
 * (@raj137)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/bug-query-display-with-array/#post-4038742)
 * Hi,
    Thanks for your response. I could figure it out today and was going to close
   the post. It was a mere cache issue that I had to clean up. Some problem in my
   computer for IE. Moreover, I had to correct the category as ‘category_names’ 
   in the code to get the array working.
 * Best Regards,
    Rajiv

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Bug- Query display with array’ is closed to new replies.

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [taxonomy](https://wordpress.org/support/topic-tag/taxonomy/)

 * In: [Networking WordPress](https://wordpress.org/support/forum/multisite/)
 * 2 replies
 * 2 participants
 * Last reply from: [raj137](https://wordpress.org/support/users/raj137/)
 * Last activity: [12 years, 9 months ago](https://wordpress.org/support/topic/bug-query-display-with-array/#post-4038742)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
