How to subscribe to entire Google Calendar

Home Forums Calendar Products Events Calendar PRO How to subscribe to entire Google Calendar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1084642
    Russell
    Participant

    Is there any way to import the entire events calendar into google at the click of a button, the same way that you would an individual event, or does the user need to import the ICAL file manually?

    #1085099
    Hunter
    Moderator

    Hello Russel,

    Welcome back and thanks for posting.

    We don’t have a built-in feature to achieve what you describe, but one of our support team members put together a handy snippet:

    /*
    * The Events Calendar Get Events for 1 Year from Today in iCal Export File
    * add coding to theme's functions.php
    * @version 3.12
    * trigger export with link: http://yoursite.com/events/?ical=1&year-feed
    * change 365 for a different range
    */
    add_action( 'pre_get_posts', 'tribe_one_year_ics_export' );
    function tribe_one_year_ics_export( WP_Query $query ) {
    if ( ! isset( $_GET['ical'] ) || ! isset( $_GET['year-feed'] ) ) {
    return;
    }
    if ( ! isset( $query->tribe_is_event_query ) || ! $query->tribe_is_event_query ) {
    return;
    }

    $query->set( 'eventDisplay', 'custom' );
    $query->set( 'start_date', 'now' );
    $query->set( 'end_date', " + 365 day" );
    $query->set( 'posts_per_page', - 1 );
    }

    Please note – I won’t be able to provide much more support around this snippet, but it should get you headed in the right direction. You can adjust the “365” according to how long a feed you want. Hopefully this helps and thanks again for posting to the support forums. Have a good one!

    #1091053
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘How to subscribe to entire Google Calendar’ is closed to new replies.