admin管理员组文章数量:1404927
I have this example of working search:
<form action="<?php echo esc_url(site_url('/')) ; ?>" method="get">
<input type="search" name"s">
<input type="submit" value="search">
</form>
and this works great, but what I want to archive is to make this search work with two more select boxes:
<form action="<?php echo esc_url(site_url('/')) ; ?>" method="get">
<select name="">
<option>Option one</option>
<option>Option one</option>
</select>
<select name="">
<option>Option A</option>
<option>Option B</option>
</select>
<input type="search" name"s">
<input type="submit" value="search">
</form>
How do I go around to make this post do something like this: mysiteDOTcom/s=option1+optionb+searchinput ? Thanks in advance
I have this example of working search:
<form action="<?php echo esc_url(site_url('/')) ; ?>" method="get">
<input type="search" name"s">
<input type="submit" value="search">
</form>
and this works great, but what I want to archive is to make this search work with two more select boxes:
<form action="<?php echo esc_url(site_url('/')) ; ?>" method="get">
<select name="">
<option>Option one</option>
<option>Option one</option>
</select>
<select name="">
<option>Option A</option>
<option>Option B</option>
</select>
<input type="search" name"s">
<input type="submit" value="search">
</form>
How do I go around to make this post do something like this: mysiteDOTcom/s=option1+optionb+searchinput ? Thanks in advance
Share Improve this question asked Dec 28, 2019 at 18:06 ArttyorArttyor 514 bronze badges 01 Answer
Reset to default 0Sorry, it's unclear to me what your goal is, if you could clarify your question more and additional information like what kind of options you're trying to use (are they custom fields, are they categories, tags, or other taxonomies, or another characteristic like post author?)
First, the select inputs should not have blank name values. (visit this a11y guide page for an example of building a search form with select lists as an example although the example is not specific to WordPress.) Having blank name values usually results in errors in a search form.
(Visit for an example search query How do I properly redirect outbound links with special characters)
本文标签: formsWordpress search with more input fields
版权声明:本文标题:forms - Wordpress search with more input fields? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744871361a2629647.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论