Forum Replies Created
-
AuthorPosts
-
Robert
Participantwp_query will do the trick for sure
But I am not sure if the following parameters will work or not?‘eventDisplay’ => ‘custom’,
‘venue’=>$venue,Robert
ParticipantThis reply is private.
Robert
ParticipantHey Cliff
The link you gave me didn’t workBut I searched a lot and solved this by following code
$event_start_date = $event_start_date1.’ 00:00′;
$event_end_date =$event_start_date1.’ 23:59′;
$meta_query = array(
‘relation’=>’AND’,
‘start’=> array(
‘key’ => ‘_EventStartDate’,
‘value’ => $event_start_date,
‘compare’ => ‘>=’,
),
‘end’=>array(
‘key’ => ‘_EventStartDate’,
‘value’ => $event_end_date,
‘compare’ => ‘<=’,
),
);if($terms && $tags){
$tax_query[] = array(
‘relation’ => ‘AND’,
array(
‘taxonomy’ => ‘tribe_events_cat’,
‘field’ => ‘slug’,
‘terms’ => $terms
),
array(
‘taxonomy’ => ‘post_tag’,
‘field’ => ‘name’,
‘terms’ => $tags
)
);}elseif($tags){
$tax_query[] = array(
array(
‘taxonomy’ => ‘post_tag’,
‘field’ => ‘name’,
‘terms’ => $tags
)
);
}elseif($terms){
$tax_query[] = array(
array(
‘taxonomy’ => ‘tribe_events_cat’,
‘field’ => ‘slug’,
‘terms’ => $terms
) );
}
else{
}if($locations){
$venue=$locations;
}global $post;
$events = tribe_get_events( array(
‘eventDisplay’ => ‘custom’,
‘posts_per_page’ => 20,
‘tax_query’=>$tax_query,
‘venue’=>$venue,
‘meta_query’ => $meta_query,
‘orderby’=>’_EventStartDate’,
‘order’=>’DESC’,
));Robert
ParticipantHey
thanks for replying..
May be I figured it out and may be its the right wayI tried this and
$tax_query[] = array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $terms ) ); $meta_query = array( array( 'key' => '_EventStartDate', 'value' => $event_start_date, 'compare' => '>', )); global $post; $events = tribe_get_events( array( 'eventDisplay' => 'custom', 'posts_per_page' => 20, 'tax_query'=>$tax_query, 'venue'=>$venue, 'meta_query' => $meta_query )); foreach ($events as $post): setup_postdata( $post ); $post->post_title; endforach;Now I am facing other issue that ‘compare’ => ‘=’ is not working ..
If I select date 2017-05-01 ,then it doesn’t show me anything ..
But is I try ‘compare’ => ‘>=’ , then i show me all the events on that date and after that
But what I want is the events on that particular day only ..
I hope you can give me a quick solution
-
This reply was modified 9 years ago by
Robert.
Robert
ParticipantI get the following warning when I try to pass array of event categories
Warning: urlencode() expects parameter 1 to be string, array given inI even noticed that when i try to get all the event categories for each event using following
$myterms = wp_get_post_terms( $event->ID, TribeEvents::TAXONOMY);or
tribe_get_event_categories($event->ID, array(
‘echo’ => false,
‘label’ => ”,
‘label_before’ => ”,
‘label_after’ => ”,
‘wrap_before’ => ”,
‘wrap_after’ => ”,
))I still get only one category per event even when most of events have multiple categories
Looking forward to your response
-
This reply was modified 9 years ago by
-
AuthorPosts
