Forum Replies Created
-
AuthorPosts
-
Hannu
ParticipantI found the solution myself. In the setting I have “Recurring event instances” unchecked and I added this to my functions.php:
function my_events_pre_get_posts( $query ) { if(! is_singular( 'tribe_events' ) ) { $query->query_vars['tribeHideRecurrence'] = 1; } return $query; } add_action( 'tribe_events_pre_get_posts', 'my_events_pre_get_posts', 1);On the events list pages I show event date range for recurring events with tribe_get_recurrence_start_dates
Hannu
ParticipantHi, OK that fixed it! But I want to only show the first parent event of recurrent events. Is there a way to enable tribeHideRecurrence checkbox by default?
(I could add ?tribe_paged=1&tribe_event_display=list&tribeHideRecurrence=1 into the navigation link, but is there any “cleaner” way to do it?)
Hannu
ParticipantWith some more searching I found this function tribe_get_recurrence_start_dates
And it returns all three recurring events correctly.
BUT it only has the start time of each event. And I would like to print each event with
DATE + Start time + End time
So I cannot fully use tribe_get_recurrence_start_dates.
Why this tribe_get_events returns only one recurring event? Same seems to be reported here: https://theeventscalendar.com/support/forums/topic/getting-all-instances-for-recurring-events/
Hannu
ParticipantHi, Thanks Jennifer. That worked and I’m now able to print the parent and the child event dates.
BUT it only works when there is 2 events (one parent and one recurring event for it)
When I add 3 events (one parent and 2 recurring events for it) then the last day is not shown for some reason.
E.g. I have
2018-09-27 (parent)
2018-10-04
2018-10-10I don’t see the 2018-10-10 event in the child event list. This query returns only one event which is the “2018-10-04”:
$recurrence_args = array( 'post_parent' => $parent_id, 'meta_key' => '_EventStartDate', 'orderby' => 'meta_key', 'order' => 'ASC', 'fields' => 'ids', 'posts_per_page' => -1, ); $child_events = tribe_get_events( $recurrence_args );Could you still help me what goes wrong with this? Thanks!
Hannu
ParticipantI tried to edit my post but I get “ERROR: Forum ID is missing.”
So I wanted to be more clear:
“When viewing either 10.10.2018 or 12.12.2018 event I would like to see in the meta details both event dates:
10.10.2018
12.12.2018”Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
Hannu
ParticipantThis reply is private.
-
AuthorPosts
