admin管理员组文章数量:1302956
I would like to expand Wordpress / WooCommerce search to allow for formulating a query-string that includes custom taxonomies. The default query-string only takes the variable ?s=
followed by a search string. I've found various posts, such as this one, that give examples of how to expand this to search custom taxonomies, etc. But it's all done through the same query-string variable (s
).
I'd like to pass the exact taxonomy and it's value, or any combination thereof.
For example:
I have custom WooCommerce product taxonomy (set up through Advanced Custom Fields) such as tax1
, tax2
, tax3
.
I have set up a search form that has a drop-down selector for each of these, populated by the values from each custom taxonomy.
I want the user to be able to select an item in one or more of the drop-downs. Upon hitting submit, this should do to a search-results
page, that is able to parse the query-string. Which might be something like ?s=&tax1=the-selection&tax2=&tax3=another-selection
The page will then display search results for all products that have tax1 equal to the-selection
AND tax3 equal to another-selection
.
What would be the recommended way to go about this? Can I achieve this through coding it into functions.php
file, or is it best achieved through an existing plug-in?
本文标签: Search custom taxonomy via querystring
版权声明:本文标题:Search custom taxonomy via query-string? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741732773a2394923.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论