Answer the question
In order to leave comments, you need to log in
Implementing a tag search filter in wordpress?
How can I implement a tag search filter in WordPress? (Without plugin).
So that for example I select the label "bmw" from the drop-down list and everything related to the label "bmw" is displayed.
Or tell me a ready-made solution.
Answer the question
In order to leave comments, you need to log in
Mb to whom it is useful
The form below allows the user to refine his choice of search from a specific tag:
<form method="get" action="<?php bloginfo('url'); ?>">
<fieldset>
<input type="text" name="s" value="" placeholder="search…" maxlength="50" required="required" />
<select name="tag">
<?php
// генератор списка меток
$tags = get_tags();
foreach ($tags as $tag) {
echo '<option value="', $tag->slug, '">', $tag->name, "</option>\n";
}
?>
</select>
<button type="submit">Поиск</button>
</fieldset>
</form>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question