Last active
December 11, 2015 11:08
-
-
Save afragen/4591089 to your computer and use it in GitHub Desktop.
Subscribe in Google Calendar/iCal. Place this code in your ecp-page-template.php file or whatever your template is.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ( function_exists( 'tribe_get_ical_link' ) ) { | |
$calurl = tribe_get_ical_link(); | |
$icalurl = preg_replace('(https?://)', 'webcal://', $calurl ); | |
$gcalurl = 'https://www.google.com/calendar/render?cid=' . $calurl ; | |
} | |
?> | |
<a href="<?php echo $icalurl; ?>" title="Subscribe to this calendar using your favorite calendar program (iCal, Outlook, etc.)" class="ical">iCal Subscribe</a> | |
<a href="<?php echo $gcalurl; ?>" title="Subscribe to this calendar in your Google Calendar" class="gcal-add" target="_blank">Subscribe in Google Calendar</a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment