Recurring Events and Event Widget
This topic contains 13 replies, has 4 voices, and was last updated by Kiran 8 years, 3 months ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket-
AuthorPosts
-
July 19, 2016 at 7:56 pm #230237
Hello. On my site I have inserted two “Event Widgets” on the home page. The “settings” on the widgets are “Todays” events and “Upcoming” events.
Here is the problem. The “Upcoming” events has a “recurring” event that is lasting many days. Thus, the recurring event is displaying and taking up the upcoming events area.. it’s a hog! lol
http://WhatsHappeningToday.com
Is there a way to “limit” a recurring event from taking up so many of the event positions on the grid?
July 20, 2016 at 11:27 am #230536Hi there,
I’ve just checked with our developer and a workaround for this would be to add the filter below to your functions.php file. However, this will limit all recurring events to display only a single event. I’d suggest that you give it a try and see if it’s what you’re looking for. Let us know how it goes.
function geodir_event_single_recurring( $groupby, $post_type ) { if ( $post_type == 'gd_event' ) { global $wpdb; $groupby = " GROUP BY $wpdb->posts.ID "; } return $groupby; } add_filter('geodir_filter_widget_listings_groupby', 'geodir_event_single_recurring', 100, 2 );
you can also do the same for search results with this snippet:
/** * Group the recurring events in search results. */ function gd_custom_group_recurring_events( $groupby, $wp_query ) { global $wpdb; if ( !empty( $_REQUEST['stype'] ) && $_REQUEST['stype'] == 'gd_event' && $wp_query->is_main_query() && geodir_is_page( 'search' ) ) { $groupby = $wpdb->posts . ".ID"; } return $groupby; } add_filter( 'posts_groupby', 'gd_custom_group_recurring_events', 100, 2 );
July 20, 2016 at 3:19 pm #230731Thank you Kor. Is there a way to limit it to a “certain number” such as 2?
July 20, 2016 at 4:14 pm #230785that’s not possible… you can only group them all.
Thanks
July 20, 2016 at 4:28 pm #230792Ok. Thank you. I will insert functions code later today. Thank you for your assistance.
August 4, 2016 at 2:03 pm #240717Yes, this is the “function” that I was referring to and it did not work. I have even disabled the recurring events in the GD setup. Might there be another way? I am going to remove the code so as not to forget to do it later. Thank you Kor and paolo.
Hey! What’s happening today?
August 4, 2016 at 6:28 pm #240893I asked to the developers to verify that function.
They’ll let us know asap.
Thanks
August 5, 2016 at 7:29 am #241111Hi there,
I checked the snippet code provided by Kor Chung and it working fine.
Please provide us site FTP access so we can help you to put that code at right place.Thanks
August 5, 2016 at 7:56 pm #241530I am setting up the ftp access now. Please let me know which files you are modifying.
August 5, 2016 at 7:58 pm #241543This reply has been marked as private.August 6, 2016 at 4:14 pm #242046Hi,
Kiran will check and let you know by Monday morning.
Thanks
August 8, 2016 at 4:47 am #242866Hi,
I have added function in file wp-content/themes/GDF_child/functions.php.
Now seems it working fine, the recurring event “Burning Man” displayed as a single in home page “Upcoming Events” widget.Let us know.
ThanksAugust 8, 2016 at 5:18 am #242871Thank you. And to confirm. This is not “just for Burning Man” but for all recurring events? May I now turn back on the recurring events function and not have this happen with other recurring events? Kind regard and much appreciation.
August 8, 2016 at 7:22 am #242908Hi,
The function will work for all recurring events.
If you want to turn back original events displaying & want to remove displaying single event instead of all recurring events then you can do it by two ways.Either by using PHP comment for the code from line no. 23 – 33
OR
By removing code from line no. 23 – 33The code will be found in the file wp-content/themes/GDF_child/functions.php
Thanks for letting us know.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket