WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can I Pass Tag ID to query()? (3 posts)

  1. cpoteet
    Member
    Posted 5 years ago #

    I'm creating custom loops on my category and tag pages. My category page works just fine with this code.

    query('showposts=-1&cat=' . $cat .'');

    However, I can't seem to get the tag page to work. This is my current find.

    query('showposts=-1&tag_id=' . $tag_id .'');

  2. MichaelH
    Member
    Posted 5 years ago #

    Try:

    $args=array(
          'tag__in' => array($tag_id),
          'showposts'=>-1,
          'caller_get_posts'=>1
        );
        query($args);

    query_posts()

  3. cpoteet
    Member
    Posted 5 years ago #

    Awesome. Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags