Title: WP 2.0 and query_posts
Last modified: August 18, 2016

---

# WP 2.0 and query_posts

 *  [tommyhilfiga](https://wordpress.org/support/users/tommyhilfiga/)
 * (@tommyhilfiga)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/wp-20-and-query_posts/)
 * I’m trying to have only posts from the category “news” being posted on my main
   page. I’ve been using qurey_posts for the WP 1~1.5 but since upgrading to WP 
   2.0 it stoped working, and I kept on getting an endless loop.
    here’s what I 
   used:
 * <?php query_posts(“category_name=news&showposts=1”); ?>
    <!– followed by a loop-
   >
 * it used to work, but not anymore. could anyone help me out here? I’m really stuck
   here… thanks in advance

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

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/wp-20-and-query_posts/#post-321479)
 * See this thread (I suspect you have the same problem):
 * [http://wordpress.org/support/topic/53272](http://wordpress.org/support/topic/53272)
 * Quick answer: Use the `cat` parameter with the numeric category ID:
 * `<?php query_posts("cat=10&showposts=1"); ?>`
 * *or* provide the full hierarchy for the category:
 * `<?php query_posts("category_name=cat-parent/news&showposts=1"); ?>`
 *  Thread Starter [tommyhilfiga](https://wordpress.org/support/users/tommyhilfiga/)
 * (@tommyhilfiga)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/wp-20-and-query_posts/#post-321601)
 * Kafkaesqui thanks a lot!! I really do appreciate it.
 * <?php query_posts(“cat=10&showposts=1”); ?>
    didn’t work. I got my usual endless
   loop. but <?php query_posts(“category_name=cat-parent/news&showposts=1”); ?> 
   worked like a charm
 * Thanks again!!
 * PS. I did search for older posts before posting but, I couldn’t find anything…
   will try to search harder next time!!

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

The topic ‘WP 2.0 and query_posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [tommyhilfiga](https://wordpress.org/support/users/tommyhilfiga/)
 * Last activity: [20 years, 3 months ago](https://wordpress.org/support/topic/wp-20-and-query_posts/#post-321601)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
