Home › Forums › Calendar Products › Events Calendar PRO › Exclude Recurring Events from This Week Widget
- This topic has 11 replies, 4 voices, and was last updated 9 years, 5 months ago by
Brad Mitchell.
-
AuthorPosts
-
October 2, 2016 at 1:40 pm #1171662
Brad Mitchell
ParticipantI use the This Week widget on the homepage (https://theeventscalendar.com/knowledgebase/pro-widget-shortcodes/#this-week-shortcode). We only show a few events per day in this widget and have multiple recurring events. Because only a few events are shown, it looks like the events are the same every day.
The General tab of the plugin’s settings page has an option to exclude recurring event instances, but it only affects the list view. Is there code I can add to exclude recurring events from the This Week widget?
-
This topic was modified 9 years, 6 months ago by
Brad Mitchell.
-
This topic was modified 9 years, 6 months ago by
Brad Mitchell.
October 3, 2016 at 9:50 am #1171834George
ParticipantHey @Drew,
This would unfortunately only be possible with some custom coding, and is a bit tricky to do; however, I wrote up a quick code snippet here for you that might do the job:
add_filter( 'tribe_events_pro_this_week_widget_query_args', 'tribe_prevent_recurring_instances_from_this_week' );function tribe_prevent_recurring_instances_from_this_week( $args ) {
$args['post_parent'] = 0;
return $args;
}☝️ Add that to your site and let me know if it helps!
Cheers,
GeorgeOctober 3, 2016 at 6:21 pm #1172019Brad Mitchell
ParticipantUnfortunately that didn’t work. I added the snippet to my theme’s functions.php file then created a recurring event. The event still appeared on every day of the widget.
In looking at our event more closely, more of them actually span multiple days instead of being recurring. It is possible instead to only show events that begin and start on the same day?
October 4, 2016 at 10:32 pm #1172563George
ParticipantHey Drew,
I’m sorry to hear this code snippet didn’t help.
This is a tricky thing to pull off, unfortunately. We cannot help with writing custom code like this, but I will give this another shot.
To clarify, you ask: “It is possible instead to only show events that begin and start on the same day?” Does recurrence matter here? What I mean is: if there is a recurring event whose instances start and end in the same day, should they be omitted from week views and week widgets because they’re recurring? Or does it not matter, and as long as the event starts and ends in same day, it should show up…?
Thanks!
GeorgeOctober 8, 2016 at 3:29 pm #1174148Brad Mitchell
ParticipantIt doesn’t matter if it’s recurring. If it begins and ends on the same day, it should show up.
October 8, 2016 at 4:00 pm #1174157George
ParticipantThanks Drew. You say, “If it begins and ends on the same day, it should show up.” — to be clear, are there any issues with these events showing up now? Or are you just saying, if it begins and ends on the same day, it should show up, but if it does not begin and end on the same day, it should not show up?
I’m sorry to ask another clarifying question here, but I just want to make sure whether you are reporting a bug or not.
Sincerely,
GeorgeOctober 9, 2016 at 11:35 am #1174293Brad Mitchell
ParticipantCorrect, all events are displaying. If it begins and ends on the same day, it should show up, but if it does not begin and end on the same day, it should not show up.
October 9, 2016 at 5:19 pm #1174359George
ParticipantThis reply is private.
October 17, 2016 at 6:47 pm #1178084Brad Mitchell
ParticipantThis reply is private.
October 18, 2016 at 9:29 am #1178418George
ParticipantThis reply is private.
November 9, 2016 at 8:35 am #1189667Support Droid
KeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
This topic was modified 9 years, 6 months ago by
-
AuthorPosts
- The topic ‘Exclude Recurring Events from This Week Widget’ is closed to new replies.
