WordPress.org

Ready to get started?Download WordPress

Forums

query_posts not working since upgrade to 2.1 (14 posts)

  1. cheeks
    Member
    Posted 7 years ago #

    I have the following code in my theme index:
    <?php
    if (is_home()) {
    query_posts("cat=-5");
    }
    ?>

    To exclude category 5. I've upgraded to 2.1, and now the category posts are showing. Has this tag changed?

  2. martinhipp
    Member
    Posted 7 years ago #

    No it hasn't changed, I just upgraded to 2.1 and works for me. In 2.1 they combined the post categories with the link categories, so check if the ID is still the same.

  3. cheeks
    Member
    Posted 7 years ago #

    Nope, that's not it; ID is still the same. Is there something that needs to go in the root index.php that I might have overwritten?

  4. callistawolf
    Member
    Posted 7 years ago #

    I have the custom query string plugin on my blog and I noticed when I put 2.1 on that I was getting ALL blog posts to the front page instead of what I had defined both in the plugin and on the options page. So I think there is some sort of an issue there.

  5. martinhipp
    Member
    Posted 7 years ago #

    I don't know then, because it works with me, sorry

  6. stuboo
    Member
    Posted 7 years ago #

    Doesn't work for me either and I haven't edited any core files. Looking forward to hearing a response on this one.

  7. moikirsch
    Member
    Posted 7 years ago #

    Do you have any plugins installed (such as Adhesive).

    Turn them off, they might be incompatible and they might be messing the loop.

  8. stuboo
    Member
    Posted 7 years ago #

    Thanks for the tip but, no dice.

  9. bmoyle
    Member
    Posted 7 years ago #

    Yep, it is also stuffed on mine too.

    query_posts('category_name=daily-podcasts&showposts=10');

    Only grabs 1 entry, even thou there are over 100 entries in the category.

  10. bmoyle
    Member
    Posted 7 years ago #

    Nop, adhesive was screwing it up.. all good now.

  11. stuboo
    Member
    Posted 7 years ago #

    Unfortunately, Adhesive wasn't the problem for me. I didn't even have it installed. I did deactivate all of my plugins in hopes that one of them was causing the problem, but that didn't work either. The code I'm using is this (in the home.php file).

    <?php
    query_posts("cat=-13");
    ?>

    I'm starting to think that I need to try a fresh install of 2.1

  12. waydomatic
    Member
    Posted 7 years ago #

    I'm getting this error:


    WordPress database error: [Unknown column 'category_id' in 'where clause']

    Seems there's no longer a 'category_id' field in the posts table.

    Have I got a screwed install, or is the new table structure in 2.1 the cause of my problem?

  13. Lee Penney
    Member
    Posted 7 years ago #

    Switching off Adhesive solved the problem for me.

  14. bongers
    Member
    Posted 7 years ago #

    I'm having the same problem :S I turned of Adhesive but the error is not gone yet.

    Any other ideas?

Topic Closed

This topic has been closed to new replies.

About this Topic