【问题标题】:Visual Composer custom query with OR operator使用 OR 运算符的 Visual Composer 自定义查询
【发布时间】:2016-06-28 20:26:39
【问题描述】:

我正在通过 Visual Composer 和来自 The Events Calendar 的结果网格使用 Wordpress。只要我只想从一个事件类别中提取但我需要从多个类别中提取,我的查询就可以工作。

我已经尝试了使用 OR 运算符的所有技巧,但无法让它发挥作用。我拥有的代码可以从一个类别中提取:

 post_type=tribe_events&post_status=publish&_EventStartDate=>$today&orderby=_EventStartDate&order=asc&tribe_events_cat=entertainment

我需要从娱乐和音乐会中提取结果。

【问题讨论】:

    标签: php wordpress visual-composer


    【解决方案1】:

    我做了足够多的挖掘和学习来弄清楚如何使用 WP_Query

    https://developer.wordpress.org/reference/functions/query_posts/
    

    以及如何通过 http_build_query 解析事物

    http://php.net/manual/en/function.http-build-query.php
    

    解决办法如下:

    post_type=tribe_events&post_status=publish&_EventStartDate=>$today&orderby=_EventStartDate&order=asc&include_category=(concerts,entertainment)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-12-07
      • 1970-01-01
      • 2019-09-11
      • 2017-07-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多