Forums

Why are my tags acting like categories? (2 posts)

  1. Roar
    Member
    Posted 4 years ago #

    I have tags. And I have categories.

    Example: I have a tag called "Spring Tour". I have a category called "Tour".

    I want to pull only the posts from Category Tour into the sidebar.

    So, I used this code.`

      <?php
      global $post;
      $myposts = get_posts('numberposts=5&offset=1&category=375');
      foreach($myposts as $post) :
      setup_postdata($post);
      ?>

    • "><?php the_title(); ?>
    • <?php endforeach; ?>

    `

    But now, it is pulling ALL posts that are tagged "tour" in them without regard to category. So, it is pulling "Spring Tour" or "Old Tour" or "Tour Archives" even if those posts have a category named "History" and NOT tour and are not in category 375.

    Help?

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

    It's a bug in get_posts(). Discussion and possible solutions mentioned here:

    http://wordpress.org/support/topic/143285

Topic Closed

This topic has been closed to new replies.

About this Topic