Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Manipulating an array of (Tribe) Events

$
0
0

Replies: 1

I have an event listing that shows events.

$args = array( 'post_type' => 'tribe_events', 'numberposts' => 3, 'order'=> 'ASC', 'orderby' => '_EventStartDate');

This also shows previous events

What I want:
1) First I want ‘upcoming’ events, maximum 3.
2) If there are not 3 upcoming events, I want to show the last ‘previous’ events (so maximum 3 if there are no ‘upcoming events.
3) It would be nice to have a different CSS class on the previous events.

PS: I chose to search on post_type in case I need to sort on tags etc. I am not sure if tribe_get_events supports that


Viewing all articles
Browse latest Browse all 59525

Trending Articles