• Hello again,

    I have a problem with the logical operators.
    I want to collect :

    • 12 posts per page
    • they must be in category 6
    • they must not be chosen if they also are in category 25.
    • they must be paged

    I tried this code, which does NOT work (I mean it does not give the expected results)

    <?php query_posts('posts_per_page=12&cat=6&cat=-25&paged='.$paged); ?>

    I tried with ‘&&’ : cat=6&&cat=-25
    I tried with ‘||’ : cat=6||cat=-25

    Does NOT work either.
    —————–
    Same problem : I need posts

    • not in category 6
    • not in category 25
    • they must be paged

Viewing 1 replies (of 1 total)
  • Thread Starter frmars

    (@frmars)

    I apparently found the solution :

    <?php query_posts(‘posts_per_page=12&cat=6,-25&paged=’.$paged); ?>
    ——————
    <?php query_posts(‘cat=-6,-25&paged=’.$paged); ?>

Viewing 1 replies (of 1 total)

The topic ‘Query, category, and PHP logical tests’ is closed to new replies.