Support » Fixing WordPress » query_posts tags and categories

  • I intend to list posts from a specific category for a specific tag.

    The following outputs nothing (before loop):

    <?php query_posts("cat=1&tag=tagtest"); ?>

    .. so I do the filtering inside the loop:

    <?php query_posts("tag=tagtest"); ?>
    loop starts here
    <?php if (in_category(1)){ ?>
    the output <?php } ?>
    loop ends here

    Is there a more elegant way for this?
    Why does query_posts("cat=1&tag=tagtest"); not work?

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘query_posts tags and categories’ is closed to new replies.