selecting multiple tags
-
Hello all, hoping someone can help with this, and i hope it makes since 🙂
I found this code and it seems to work to allow users to get search results after selecting multiple tags…
<form method="get" action="<?php bloginfo('url'); ?>"> <fieldset> <input type="hidden" name="s" value="" placeholder="search…" maxlength="50" required="false" /> <p>Refine search to posts containing chosen tags:</p> <?php // generate list of tags $tags = get_tags(); foreach ($tags as $tag) { echo '<label>', '<input type="checkbox" name="tag[]" value="', $tag->slug, '" /> ', $tag->name, "</label>\n"; } ?> <button type="submit">Search</button> </fieldset> </form>However I would like to limit it to tags that are listed under a specific category when viewing the category achieve page…. I found this bit of code (see below) that will display the tags used in post under that category, but it only lets you select one at a time… can anyone help me integrate the two?
<?php query_posts('category_name=recipes'); if (have_posts()) : while (have_posts()) : the_post(); if( get_the_tag_list() ){ echo $posttags = get_the_tag_list('',' ',' '); } endwhile; endif; wp_reset_query(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘selecting multiple tags’ is closed to new replies.