having duplicate tags ignored in only one query_post
-
Hi I have a question regarding tags in query_post.
My goal is to have all tags used in a query echoed but I don’t want the same tag echoed more the once.
I was thinking of the duplicate post technique but it needs two queries.
It could have to do with the way I am querying as well… maybe needs arrays and variables… it’s getting a touch out of my wp understanding…
I am sure there’s a way to kill a duplicate entry so can somebody help me out or give me a lead to a similar problem that was resolved?
Thanks heaps,
Brian<ul id="filter"> <?php query_posts("posts_per_page=-1&cat=5");?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <?php global $post; if ( has_tag() ) { ?> <li><a href="#"><?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ''; } } ?></a></li> <?php } else { }?><?php endwhile; ?><?php endif; ?> </ul>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘having duplicate tags ignored in only one query_post’ is closed to new replies.