Support » Fixing WordPress » query_posts(“cat=#”) not working

  • Resolved the_tim

    (@the_tim)


    Okay I’m going crazy here. The following code works great:

    <?php	query_posts("tag=sometag");
    while(have_posts() && $i <= $posts_wanted) : the_post(); ?>
    ...
    [do stuff]
    ...
    <?php endwhile; ?>

    But if I try to do the same loop and specify a category instead of a tag, it returns all posts (not just posts in that category):

    <?php	query_posts("cat=3");
    while(have_posts() && $i <= $posts_wanted) : the_post(); ?>
    ...
    [do stuff]
    ...
    <?php endwhile; ?>

    What is going on here? I’ve tried everything I can think of to get this to work and nothing seems to do the trick!

Viewing 1 replies (of 1 total)
  • All right so it turns out I thought of one more thing that I hadn’t tried.

    I thought about what plugins I was using that mess with the categories, deactivated Ultimate Category Excluder, and tried again.

    Ta-da, everything works fine. So a word of warning to anyone using that plugin, it messes up the ability to properly run query_posts.

Viewing 1 replies (of 1 total)
  • The topic ‘query_posts(“cat=#”) not working’ is closed to new replies.