WordPress.org

Forums

query_posts tags and categories (3 posts)

  1. karimun
    Member
    Posted 7 years ago #

    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?

  2. SimonJ
    Member
    Posted 7 years ago #

    Why does query_posts("cat=1&tag=tagtest"); not work?

    It's a bug...

    If you search in this forum for "query_posts tags, category", you should find this thread where you can read a solution :

    http://wordpress.org/support/topic/152904?replies=26

    S.

  3. karimun
    Member
    Posted 7 years ago #

    Thank you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.