The MU forums have moved to WordPress.org

query_posts not work with minus sign (1 post)

  1. ZDJL505
    Member
    Posted 14 years ago #

    I want to exclude certain category (e.g for category_ID=47) from the loop. I have try 3 kind of code (with minus sign):
    query_posts($query_string . "&cat=-47");
    or
    query_posts("cat=-47");
    or
    query_posts('cat=-47');
    But all of them are not work to exclude.

    Just for checking, if I try using code (without minus sign):
    query_posts($query_string . "&cat=47");
    or
    query_posts("cat=47");
    or
    query_posts('cat=47');
    All of them are work to show posts only from category_ID=47.

    Why in my case query_posts does not recognize minus sign? Is this problem with my database or with my query.php/classes.php? Is this typical of WPMU that can not exclude posts in query_posts?

    My server configuration:
    WPMU 2.9.2
    PHP 5.2.9
    MySQL 5.0.90-community-log
    Apache 2.2.11

About this Topic

  • Started 14 years ago by ZDJL505