dongying9756 2016-04-21 14:37
浏览 90

使用GET和AJAX的Wordpress WP_QUERY

Recently I've been developing on a Wordpress theme, where you can filter different products (A post type) based on custom fields (metaboxes).
After a lot of hard work, I finally found a way to do it, by using the "array" from "get" url, check if it's set and if it is, then pass the array into the WP_QUERY.
Hope this image explains it a bit better

enter image description here

I'm doing it with this code: http://pastebin.com/T5ihsCw3

But now I would really like to update the query, every time a checkbox is checked (or unchecked), by using Ajax. I just can't get it to work, because I NEED to use the "GET" from the URL, and I can't find a guide on THAT specific thing.

Any help would be greatly appreciated! Thanks!

Frederik

  • 写回答

1条回答 默认 最新

  • dsnw2651 2016-04-21 16:47
    关注

    See this post. It shall give you an idea on how to solve your problem:

    WordPress: How to get metadata of Custom Fields from Custom Taxonomy with using jQuery

    You need to create a function that can be queried by Ajax and then every time one of the checkboxes is checked, you just issue an Ajax get request.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?