iCal for all future events

Home Forums Calendar Products Events Calendar PRO iCal for all future events

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #968931
    Honey Shelton
    Participant

    We are looking at building an app and are exploring event calendar integration. In most app builders, the easiest way to do this is with iCal functionality. However if I use http://www.oursite.com/events/?ical=1&full-export it only retrieves the calendar for the current month. Is there a way to get all future events?

    #968991
    Barry
    Member

    Hi hshelton,

    Adding “full-export” is not something The Events Calendar understands by itself, you’d need to add some code such as discussed in this topic.

    Does that help?

    #969226
    Honey Shelton
    Participant

    Yes, that will definitely help but my php knowledge is limited to editing some woocommerce account page files to make them look differently. Do I add this to WP’s functions.php or to one of The Event Calendar .php files?
    Can I add this to a php file in our child theme that would get loaded in addition to the core files?

    This is what I think I need to add.

    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', 'now′ );
    $query->set( 'end_date', '3000-01-01′ );
    $query->set( 'posts_per_page', '-1′ );
    }
    #969228
    Barry
    Member

    The functions.php file within your theme or child theme is certainly one place you can add it – alternatively you could place it in a custom plugin, but often people find the first of those options (the theme’s functions.php file) to be easiest route 🙂

    #973876
    Barry
    Member

    Hi!

    It’s been a while so I’m going to go ahead and close this topic.

    • Need help with anything else? Go right ahead and post a new topic, one of the team will be only too happy to help
    • Still need help with this issue and need to re-open it? Again, please simply create a new topic and link to this one to provide the team with some context

    Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘iCal for all future events’ is closed to new replies.