【发布时间】:2017-06-02 16:21:46
【问题描述】:
所以我觉得我让自己过得很艰难。
我的网站上有一个搜索字段,已分成 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 名称。
希望这是有道理的,任何帮助将不胜感激!
【问题讨论】:
标签: php wordpress woocommerce wordpress-theming advanced-custom-fields