Hello,
I added two categories to an article
(ex. Posted in 'General' and 'Design')
However, I do not want 'General' to display.
Any thoughts?
Hello,
I added two categories to an article
(ex. Posted in 'General' and 'Design')
However, I do not want 'General' to display.
Any thoughts?
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?
This topic has been closed to new replies.