• Hello,

    I added two categories to an article

    (ex. Posted in ‘General’ and ‘Design’)

    However, I do not want ‘General’ to display.

    Any thoughts?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I’d like to know how to do this as well.

    There might be a way to do this using get_the_tags. Modifying the codex example:

    <?php
    $ignore_tags = array("general", "another-tag-slug");
    $posttags = get_the_tags();
    if ($posttags) {
    foreach($posttags as $tag) {
    if( !in_array($tag->slug, $ignore_tags) ) {
    echo $tag->slug . ' ';
    }
    }
    }
    ?>

    Referencing the codex, you could presumably do this by defining id numbers too. I haven’t tested the above but would imagine it’d work?

    J

    Incidentally, is there a reason why you are not just removing the ‘general’ tag from these posts, or in fact removing the tag entirely?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exclude a certain category in a post’ is closed to new replies.