带有 OR 运算符的 Visual Composer 自定义查询 [英] Visual Composer custom query with OR operator

查看:28
本文介绍了带有 OR 运算符的 Visual Composer 自定义查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am working with Wordpress via Visual Composer and a post grid of results from The Events Calendar. I have the query working as long as I only want to pull from one events category but I need to pull from multiple categories.

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

I have tried all of the tricks using OR operators and cannot get this to work. The code I have that works to pull from one category:

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

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

I need to pull results from Entertainment and Concerts.

推荐答案

我做了足够多的挖掘 &学习如何使用 WP_Query

I did enough digging & learning to figure out how to use the WP_Query

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

以及如何通过 http_build_query 解析事物

and how things get parsed through 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)

这篇关于带有 OR 运算符的 Visual Composer 自定义查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆