Forum Replies Created
-
AuthorPosts
-
Marty
ParticipantHi. Yes, a new ID is created anytime you make a change that does not affect every recurrence. For example, if you make a change to the 2nd instance of a recurring event and choose “Future Events” when saving, that instance (and all future instances) will be given a different ID than the 1st entry. Same if you were to choose “This Event Only” — that instance would be given a unique ID.
Moving forward I’m going to pick up the trail left by Cliff, above.
Marty
ParticipantI’m not sure the solution I posted above is bullet proof. I haven’t gone too deep into it yet, but it seems that there are cases when instances of an event may become separated from the others and given their own post ID.
Perhaps someone can shed more light on this?
Marty
ParticipantHi Jonah,
Sorry, that didn’t work for me. I was able to do it (so far so good, at least) using WP_Query with meta_query:
$thisyear = get_post_meta($post->ID, 'year', true);
$nextyear = $thisyear + 1;$args = array(
'post_type' => 'tribe_events',
'posts_per_page' => -1,
'orderby' => 'meta_value',
'meta_key' => '_EventStartDate',
'meta_query' => array(
array('key' => '_EventStartDate',
'value' => array($thisyear . '-01-01 00:00:00', $nextyear . '-01-01 00:00:00'),
'type' => 'DATETIME',
'compare' => 'BETWEEN'
)));
$the_query = new WP_Query( $args );
Marty
ParticipantHi Jonah, thanks for the response. Can you tell me a bit more about tribe_get_events()? I’m trying this:
'eventDisplay'=>'past',
'start_date'=> '1 Jan 2004',
'end_date'=> '31 Jan 2004',
'posts_per_page'=>-1
But it’s including events all the way up to yesterday. I take it end_date’s not what I need in this case? What’s the correct way to limit a query to events beginning within a certain date range?
Thanks
Marty
ParticipantI found it was really easy to detect recurring events via the post ID. I added post IDs to an array and then checked against it, as follows:
$postids = Array();
while ( have_posts() ) : the_post();
$thisid = get_the_ID();
if ( !in_array($thisid, $postids)) :
array_push($postids, $thisid );
// Output the post
endif;
endwhile;
Marty
Participant@Cliff I’m looking to do this same thing. Would you able to post a snippet of the conditions you created? Cheers
Marty
ParticipantI’m in the same situation as the others on this thread — theatre performances that recur at an irregular pattern. The ideal solution would involve not only dates, but times too (a matinee, for instance).
Would very much like to see this feature. Cheers
-
AuthorPosts
