WordPress.org

Forums

[resolved] query_posts("cat=#") not working (2 posts)

  1. the_tim
    Member
    Posted 6 years ago #

    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!

  2. the_tim
    Member
    Posted 6 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic