Forums

complex exclude (3 posts)

  1. AnimaliX
    Member
    Posted 10 months ago #

    Hi, I am a newbie and have this problem:
    need exclude specific posts only with specific tags from specific cathegory ... plugins like Simply Exclude is not specific enough :)

    for example: i have in cathegory "PRESS" some posts with tag "ABC" and i need this posts exclude (Do not show) in "PRESS" cathegory

    ps. sorry for my english :P

  2. esmi
    Theme Diva & Forum Moderator
    Posted 10 months ago #

  3. AnimaliX
    Member
    Posted 10 months ago #

    i experimenting with this

    <?php
    $skip = false;
    $skip_tag = 'demo';
    $tags = get_the_tags($post->ID);
    if ($tags) {
      foreach ($tags as $tag) {
        if ($tag->name == $skip_tag) {
          $skip = true;
        }
      }
      if (!$skip) {
        //your post display stuff goes here -- like the_title, the_content, the_excerpt
      }
    }
    ?>

    from http://wordpress.org/support/topic/how-to-hide-post-by-tag?replies=2

Reply

You must log in to post.

About this Topic