使用分类法创建高级搜索
和往常一样,在为一个问题苦苦思索三天后,我决定在这里寻求帮助。
我正在尝试创建一个带有分类法和关键字字段的高级搜索页面。你可以在 http://alianzasuperior.com/empleo/busqueda-avanzada/ (不要惊慌,它是西班牙语,但只要将其视为分类法就可以了)
关键字部分工作正常。我还可以创建分类页面,例如taxonomy-job_type.php 来处理单个分类,它也有效。
问题是当我尝试搜索多个分类法以及这些分类法的多个术语时。我试图用 scribu 插件“查询多个分类法”来解决这个问题,但我做不到。
有人为我想做的事情做了类似的事情吗?
任何帮助或线索我都会非常感激
as always after struggling my mind for 3 days with a problem i decide to ask for help here.
Im trying to create an advance search page with taxonomies and keyword field. You can see what i actually got in http://alianzasuperior.com/empleo/busqueda-avanzada/ ( dont panic, its spanish but just think as taxonomies and you will be ok)
The keyword part is working fine. I can also create taxonomies pages for example taxonomy-job_type.php to handle an individual taxonomy and it works aswell.
The problem is when i try to search in multiple taxonomies , and multiple terms for those taxomies. I tried to figure it out with scribu plugin "query multiple taxonomies" but im not able.
Someone did something similiar for what im trying to do?
Any help or clue will me much appreciate
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
和你一样,我也在深入挖掘 wordpress 多重搜索,
在 wordpress stackexchange 中查看我的问题,它可能对您有帮助。
到目前为止我还没有成功。
https://wordpress.stackexchange.com/questions/27158/wordpress-multiple-category-search< /a>
Like you I am also digging in depth of wordpress multiple search,
check out my question in wordpress stackexchange, it might help you.
Till yet I also had no success in it.
https://wordpress.stackexchange.com/questions/27158/wordpress-multiple-category-search
和其他时候一样,在这里发帖后我发现了自己的问题。也许这不是更聪明的解决方案,但它对我有用。
我使用新的tax_query,如 http://www. wpmods.com/query-multiple-taxonomies-in-wp-3-1/
基本上,如果我得到 2 个带有两个术语的分类法,例如,
我会执行以下操作:
我会执行以下操作:然后,如果我得到多个术语, 使用自定义查询:
如果您想将其与关键字搜索混合,只需执行以下操作:
希望有帮助,我刚刚发现,到目前为止我的测试运行良好
like other times, after posting here i found my own question. Maybe its not the smarter solution but its working for me.
Im using the new tax_query as commented in http://www.wpmods.com/query-multiple-taxonomies-in-wp-3-1/
Basically if i get 2 taxonomies with two terms for example
I do the following:
And then if i got more than one term i use the custom query:
If you want to mix it with keyword search just do:
Hope that helps, I just discovered and so far my tests are working fine