Home › Forums › Calendar Products › Events Calendar PRO › Full .ics export
- This topic has 4 replies, 2 voices, and was last updated 11 years, 3 months ago by
Barry.
-
AuthorPosts
-
January 14, 2015 at 9:31 am #932789
Michael
ParticipantIs there a way to do a full ics export of the entire Calendar?
January 14, 2015 at 10:32 am #932828Barry
MemberHi!
It’s possible, yes. Do note that customizations like this are really something you need to drive forward by yourself, but as a possible starting point how about adding a snippet like this to a custom plugin or your theme’s functions.php file?
add_action( 'pre_get_posts', 'full_ical_export' ); function full_ical_export( WP_Query $query ) { if ( ! isset( $_GET['ical'] ) || ! isset( $_GET['full-export'] ) ) return; if ( ! isset( $query->tribe_is_event_query ) || ! $query->tribe_is_event_query ) return; $query->set( 'eventDisplay', 'custom' ); $query->set( 'start_date', '1000-01-01' ); $query->set( 'end_date', '3000-01-01' ); $query->set( 'posts_per_page', '-1' ); }Then, if you visit example.com/events/?ical=1&full-export (of course modify the URL to match your own site) it should generate an iCal feed of all events past, present and future.
Do also be aware that if you have a very large number of events this could potentially cause some timeout/memory challenges, depending on your server setup.
I hope that helps!
January 14, 2015 at 11:52 am #932879Michael
ParticipantBarry
Thank you for the guidance.
I ran the script as you outlined and it only produced 5 events out of 500+.
Any insight?
Mike
January 14, 2015 at 12:35 pm #932908Barry
MemberI unfortunately see the “white screen of death” when I try it directly on your site (using the URL you provided when you opened this topic).
How many events do you have in total? Perhaps it’s a memory issue and execution is ending before the list can be fully generated. One way to test this theory is modify the ‘-1′ element of the snippet to ’50’ – if it produces 50 results as expected, it’s basically doing its job.
Begin increasing it to higher numbers and ultimately back to unlimited (-1) – see if there is a point at which it stops working.
Does that provide any useful results?
January 29, 2015 at 6:53 am #938787Barry
MemberHi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!
-
AuthorPosts
- The topic ‘Full .ics export’ is closed to new replies.
