php - Creating (Complex?) Custom Queries for Wordpress compatible with Visual Composer -


i'm struggling make 2 custom queries visual composer:

  1. a query display posts published date after today's date (have plugin publishes future posts) in ascending or descending order (whichever makes show soonest upcoming event first)

  2. a query display posts meet multiple category requirements (eg. categories 'upcoming' , 'class' or 'upcoming' , 'social'

really, either of these should give me results want, first convenient.

i can't life of me decipher codex's page on custom queries , figure out how them work outside of context of php page, , in context of visual compose.

one thought had perhaps need add custom query functions.php has name, , call query variables visual composer? right idea? how such thing/call new query?

i've tried following satisfy #1 , seems have disregarded query altogether , displayed events:

[vc_basic_grid post_type="custom" grid_id="vc_gid:1473741223498-3776c0d3-292b-4" custom_query="wp_query( ''showposts=20&monthnum=' . date_query( array( 'after', . now() . ) ) . '&order_by=date&order=desc')"]  [vc_separator]  [vc_basic_grid post_type="custom" grid_id="vc_gid:1473741223504-67e7758b-8892-6" custom_query="$args = array( 'date_query' => array( array( 'after' => now(), 'inclusive' => true, ), ), 'posts_per_page' => -1, 'order_by' => 'date', 'order' => 'asc' ); $query = new wp_query( $args );"] 

would love nudges in right direction! thank :)

i did similar not long ago , used following far date & making sure pulled posts "today" , in future.

_eventstartdate=>$today 

that pulling upcoming events custom post type. said, code scenario retrieving normal posts:

date=>$today 

here's whole custom query works pull events i'm stuck on trying figure out how pull multiple categories well:

post_type=tribe_events&tribe_events_cat=featured&post_status=publish&_eventstartdate=>$today&orderby=_eventstartdate&order=asc 

please follow once have solution.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -