WordPress.org

Support

Support » Themes and Templates » [Resolved] How to query posts category ID AND has tag ID?

[Resolved] How to query posts category ID AND has tag ID?

  • Hi, thanks for helping. I’m so close…

    I have a basic Page template that outputs rows of Posts within a Category. I’m trying to also have this page output rows that are inside the Category and are Tagged.

    This works but only with a single tag_id. It will show tag 77, but 77,88 doesn’t work:
    query_posts('cat=1,2,3,4&tag_id=77,88');

    This works if I just want to output posts by tag but no category:
    query_posts( array('tag__in' => array(77,88)) );

    I feel like I’m 95% there, but can’t figure out how to query_posts that are Category ID 1,2,3 and has Tag ID 77,88.

    Appreciate all help, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Resolved] How to query posts category ID AND has tag ID?’ is closed to new replies.
Skip to toolbar