我问了这个关于堆栈溢出的问题,但到目前为止还没有任何乐趣。链接:https://stackoverflow.com/questions/41716882/wordpress-search-form-and-search-result-through-acf-field-in-custom-taxonomy/41718983#41718983
以下问题的副本:
所以我觉得我让自己的生活很艰难。
我在我的网站上有一个搜索字段,我已将其分为3个,例如:
<input type="text" name="part1" />
<input type="text" name="part2" />
<input type="text" name="part3" />
在我的结果页面上,我创建搜索字符串,例如:$searchstring = $part1.\'-\'.$part2.\'-\'.$part3;
然后,过程是在数据库中搜索值为的自定义字段$searchstring
我找到了一个搜索功能https://gist.github.com/jserrao/d8b20a6c5c421b9d2a51 我认为这与我想要实现的目标非常接近,但我真的不确定如何实现其中的所有内容。
我的数据大致如下:
(taxonomy) product_cat - (name) Category 1 - (custom field) gc_number - (value I need to search) 77-999-77
(taxonomy) product_cat - (name) Category 2 - (custom field) gc_number - (value I need to search) 73-333-73
(taxonomy) product_cat - (name) Category 3 - (custom field) gc_number - (value I need to search) 76-666-76
然后我需要显示product_cat
用户的名称。希望这是有意义的,任何帮助都将不胜感激!