Forum Replies Created
-
AuthorPosts
-
JoakimParticipant
Thanks! Your answer led me to this very simple solution; by adding
'post_parent' => 0
to the parametres.- This reply was modified 6 years ago by Joakim.
March 2, 2018 at 1:25 am in reply to: Remove dashboard message about geolocation (a follow-up) #1467976JoakimParticipantAwesome, this did the trick. Thanks!
JoakimParticipantThis reply is private.
February 12, 2018 at 1:14 am in reply to: How do I list out a number of events based on different criteria in a template? #1450387JoakimParticipantThank you!
February 8, 2018 at 1:32 am in reply to: How do I list out a number of events based on different criteria in a template? #1447322JoakimParticipantAnyone?
Solved that last one myself too.
Get today’s date like this: $today = date(“Y-m-d”);
Then update the WP Query’s args like this:
$args = array(
'post_type' => array('tribe_events'),
'meta_query' => array(
array(
'key' => '_EventStartDate',
'value' => $today,
'compare' => '>=',
)
),
'tribe_events_cat' => $main_category,
'posts_per_page' => '4',
'orderby' => '_EventStartDate',
'order' => 'ASC',
);>
is supposed to be ‘>’ obviously.February 7, 2018 at 9:18 am in reply to: How do I list out a number of events based on different criteria in a template? #1446528JoakimParticipantSomehow I found it out. I’m supposed to use ‘tribe_events_cat’.
I think we should be able to find a list of event metadata somewhere in the documentation, but I couldn’t find it. It’s quite possible I suck at searching.
How do I make sure only events with start date after today (or a custom date) gets queried? Here’s my wp_query so far:
// WP_Query arguments
$args = array(
‘post_type’ => ‘tribe_events’,
‘tribe_events_cat’ => ‘movies’,
‘posts_per_page’ => ‘4’,
‘orderby’ => ‘_EventStartDate’,
‘order’ => ‘ASC’,
);// The Query
$query = new WP_Query( $args );February 7, 2018 at 8:29 am in reply to: How do I list out a number of events based on different criteria in a template? #1446361JoakimParticipantI’m able to list events with a regular wp_query, but how do I list only events within a certain event category?
I’ve tried using ‘category_name’, but that doesn’t work:
// WP_Query arguments
$args = array(
‘post_type’ => ‘tribe_events’,
‘category_name’ => ‘movies’,
‘posts_per_page’ => ‘4’,
‘orderby’ => ‘date’,
);// The Query
$query = new WP_Query( $args ); -
AuthorPosts