I am using pods as my custom field plugin and I am getting the iCal feed for our custom post type for events to work fine, save for the custom link. For our custom post type we have a field called “regfox_slug” and it has an https:// URL in the field. It is an external link to our wordpress site so that when people click on our events they go to the external event page. However, when using the URL parameter &customlink=regfox_slug I can’t seem to get the .ics file to add the URL to the event listing in Outlook or Google Calendar.
]]>Hey. How does the update interval works? I add new eventos or make changes to events and they only update in Apple Calendar. In Google Calendar and Outlook Calendar they are not updated.
]]>I’m trying to have an event calendar for my users to download and import to there calendar apps, i can upload to outlook but can’t import to google calendar can any one help me with my problem.
the ics link is: https://informador.pt/?ical&datefield=data&posttype=evento&icsname=Agenda-Fiscal
]]>Hey @maximevalette I’ve added a new Pull Request to add the ability for a custom field to be used for the event link.
]]>Hey @maximevalette I’ve added a new Pull Request with various additions from user’s feedback here and my own needs. Hope this can be officially added soon.
https://github.com/maximevalette/ical-feeds/pull/3
I set my start date with “&datefield=mycustomfield”, which works great.
What’s the parameter I need to use for setting the start time with custom field data?
Right now every event is set to “T220000Z”. I left “Start Time per post” unchanged (0:0).
]]>I am able to only see future posts. But when I publish a page I am not seeing it populate in the ical feed. I am using the Apple calendar.
]]>Is it possible to output just a single post?
For example merl.com/?ical&datefield=event_date&post=postidhere
Hi again,
You can overrule the default date(s) and use your own date field(s) by adding an extra parameter “datefield” and “enddatefield”.
So I’ve added these parameters to the URL but I notice this isn’t working in my case, because the date format of my post meta fields do not match the iCal date format.
My date format is the default PHP date format (Unix Epoch).
How can I meet the date conditions of your plugin?
Guido
]]>Hi,
I use an events plugin that doesn’t support the default(?) iCal fields for Description, Location, Start-date and End-date.
Is it somehow possible to add a feature to your plugin, where user can define those fields? In that case I can add my custom fields to the iCal feed.
Guido
]]>Hi,
Could you add some more info about the features of this plugin in your readme file, because I have to install plugin first, in order to find out which features it has.
For example:
Apparently it also supports custom post types, but I had to find out via the plugin supportpage.
Thanks in advance.
Guido
]]>Hey guys- great plug-in. This is (in theory) exactly what I needed. I’m so glad you put this together.
I’m having difficulty getting the date portions to work. I’m pulling from a custom post which was created by user-submitted form data. I’m using the Toolset plug-in for all of that.
But while your plug-in is allowing me to download .ics files for the right post type, it isn’t pulling the dates. I have slugs/tags for both start and end date, but nothing seems to work.
Any ideas? I can always give you admin rights to my site. I know this is free, but I’m down for providing “charitible donations” if you can help. thanks!
]]>Hey @maximevalette I’ve majorly rewritten the plugin to better implement some of the features we’ve added in the last few revisions like the custom datefield, timezone support for the custom datefield, and a new control of how many days into the future to show events.
Improvements include:
– New Number of Future Posts setting
– Replaced get_results with Wp_Query
– Better implementation of the custom date field to filter results returned
– Timezone support for the custom date field
– Reorganized code & Added comments
Here is my revised php file:
https://www.dropbox.com/s/tgicm1fv7ergg9v/ical-feeds.php?dl=0
Let me know what you think.
]]>While testing importing the iCal into non-Apple calendars I consistently get errors. When I run the iCal feed through a validator it throws errors like this:
Error at line 11:Cannot set timezone for UTC
It points to DSTAMP and the way the plugin uses timezones. Then I found a bunch of articles pointing to the need for only using the Z format.
So I’m suggesting these changes:
change this
$start_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) );
$end_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) + ($options['icalfeeds_minutes'] * 60));
to this:
$start_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) );
$end_time = date( 'Ymd\THis', get_post_time( 'U', true, $post->ID ) + ($options['icalfeeds_minutes'] * 60));
And then change this:
$modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', false, $post->ID ) );
to this:
$modified_time = date( 'Ymd\THis', get_post_modified_time( 'U', true, $post->ID ) );
and finally change this:
if ($timezone === 'UTC') {
$start_time = ":$start_time" . 'Z';
$end_time = ":$end_time" . 'Z';
$modified_time = ":$modified_time" . 'Z';
} else {
$start_time = ";TZID=$timezone:$start_time";
$end_time = ";TZID=$timezone:$end_time";
$modified_time = ";TZID=$timezone:$modified_time";
}
to this:
$start_time = ":$start_time" . 'Z';
$end_time = ":$end_time" . 'Z';
$modified_time = ":$modified_time" . 'Z';
Hope that helps.
]]>Hi – thanks so much for this plugin!
Was wondering, based on the last post in the support forum – would it be possible to add a parameter to control end dates specifically? Asking because my events have varied times associated – some are all day, some just a few hours, some a few days long.
Thanks again!
]]>Thanks so much @n00bie12 in this thread for the initial solution. I’ve created a small addition which I hope can be included in the core. I’ve updated the code so that it can grab any custom field in the Post Meta table without the need of the ACF plugin to grab the field.
This will allow for any feed to have a custom “datefield” variable to be added like so:
https://yourdomain.com/?ical&datefield=event_date
Edit file: ical-feeds.php
around line 194 add:
echo '<h2>'.__('Custom Date iCal feed', ICALFEEDS_TEXTDOMAIN).'</h2>';
echo '<p>'.__('You can use a custom date field instead of the deafult publish date. The Meta Key must exist in the Post Meta table.', ICALFEEDS_TEXTDOMAIN).'</p>';
echo '<p>Example Date meta_key: "event_date" <a href="'.site_url().'/?ical&datefield=event_date" target="_blank">'.site_url().'/?ical&datefield=event_date</a></p>';
then around line 246 add:
$post_date_field = 'pubDate';
if (isset($_GET['datefield'])) {
$post_date_field = $_GET['datefield'];
}
finally around line 310 replace this:
$start_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) );
$end_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) + ($options['icalfeeds_minutes'] * 60));
with this:
if ($post_date_field != 'pubDate'){
$start_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_date_field, true ) ) );
$end_time = date( 'Ymd\THis', strtotime( get_post_meta( $post->ID, $post_date_field, true ) ) + ($options['icalfeeds_minutes'] * 60));
} else {
$start_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) );
$end_time = date( 'Ymd\THis', get_post_time( 'U', false, $post->ID ) + ($options['icalfeeds_minutes'] * 60));
}
Hope that helps!
]]>I utilize a plugin call Tevolution for event creation. I have Start Date End Date as ‘date’ variables (st_date,end_date) and Start Time and End Time as ‘text’ variables (st_time, end_time). I am attempting to use your plugin in conjunction with a skill for the Amazon Echo that reads ical feeds – https://github.com/alexa/skill-sample-nodejs-calendar-reader. When following all steps properly, I cannot get your plugin to read my custom field values generated from the Tevolution Event Plugin. Please let me know your thoughts. Thanks!
]]>I added custom post type support to this plugin.
Edit the ical-feeds.php
1) after this line:
echo '<p id="categoriesUrl" style="display: none;">'.__('URL:', ICALFEEDS_TEXTDOMAIN).' <a href="'.site_url().'/?ical&category=" data-baseUrl="'.site_url().'/?ical&category=" target="_blank">'.site_url().'/?ical&category=</a></p>';
add this:
echo '<h2>'.__('Post Type iCal feeds', ICALFEEDS_TEXTDOMAIN).'</h2>';
echo '<ul>';
$args = array(
'public' => true,
'_builtin' => false
);
$post_types = get_post_types($args);
foreach ($post_types as $post_type) {
echo '<li><a href="'.site_url().'/?ical&posttype='.$post_type.'" target="_blank">'.site_url().'/?ical&posttype='.$post_type.'</a> — '.__('Public iCal feed for', ICALFEEDS_TEXTDOMAIN).' '.$post_type.'</li>';
}
echo '</ul>';
2) after this line:
if (!isset($options['icalfeeds_minutes'])) $options['icalfeeds_minutes'] = 60;
add this:
$post_type = 'post';
if (isset($_GET['posttype'])) {
$post_type = $_GET['posttype'];
}
3) replace both of the quires with this:
// Get posts
if (isset($_GET['category'])) {
$posts = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_content, UNIX_TIMESTAMP($wpdb->posts.post_date) AS post_date, $wpdb->posts.post_title FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
WHERE (".$postCond.") AND $wpdb->posts.post_type = '$post_type' AND $wpdb->term_taxonomy.taxonomy = 'category' AND $wpdb->term_taxonomy.term_id IN (".implode(',', $categoryIds).")
ORDER BY post_date DESC $limit");
} else {
$posts = $wpdb->get_results("SELECT $wpdb->posts.ID, $wpdb->posts.post_content, UNIX_TIMESTAMP($wpdb->posts.post_date) AS post_date, $wpdb->posts.post_title
FROM $wpdb->posts
WHERE (".$postCond.") AND $wpdb->posts.post_type = '$post_type'
ORDER BY post_date DESC $limit");
}
4) I also changed X-WR-CALDESC variable to:
X-WR-CALDESC:Posts from {$blog_name}
Hope this can be implemented in the core plugin.
]]>I’ve tried numerous times to add the ical link with the secret parameter to view scheduled posts to Google calendar and all it is showing is past/published posts.
]]>Hi,
I hope I can describe the error with my bad English …
I have created a secret parameter value, because I want to show only the future planned posts of my blog in my desktop mail software OUTLOOK 2013 (Windows 7 prof.).
I have imported the ical feed in Outlook, but there are now 2 strange behaviours:
1. it does not show planned posts at all (yes, I do have some ??
2. It shows all already published posts together with this error when I import it to Outlook – it is in German (https://screencloud.net/v/2Sve), but I try to translate this error in English:
Error (0x0004003F) "Internetcalenderabonnements":
The value VEVENT in line 33 of the post "...." does not contain a DTSTART and not a DTEND value.
Outlook assumes, that the event begins today.
This error is all the same for all already published posts, that are imported with this ical feed.
I have only used the “private” ical feed, because I only want to show my future planned posts. But it shows ALL and NONE of the future ones.
And yes, I have imported in Outlook only the URL of the Private iCal feed with the Secret parameter value.
Any idea please?
Thank you!
Thank you for the handy plugin! What should I do if I need the event date to come from a custom field (let’s call it “custom_date”) instead of from the post date?
I tried going through ical-feeds.php and replacing every instance of “post_date” with “custom_date”, but then the calendar feed comes up empty (i.e., it contains no events).
]]>I’d like to change the code to also support multiple categories… not sure if anyone has done this yet.
]]>Thanks for the plugin. Does exactly what I was after. One thing, looks like changes to wordpress categories make that part no longer work.
I changed this part of the code to fix
$posts = $wpdb->get_results(“SELECT * FROM $wpdb->posts
LEFT JOIN $wpdb->term_relationships ON
($wpdb->posts.ID = $wpdb->term_relationships.object_id)
LEFT JOIN $wpdb->term_taxonomy ON
($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)
WHERE $wpdb->posts.post_status = ‘publish’
AND $wpdb->term_taxonomy.taxonomy = ‘category’
AND $wpdb->term_taxonomy.term_id = $category_id
ORDER BY post_date DESC $limit”);
Hi,
thank you very much for your plugin. Unfortunately, the iCal-Feed doesn’t read our local time (GMT+1 + 1h summertime), but takes UTC-time. Any chance to get the right time out of wordpress?
Anja
]]>Really nice plugin – like how useful but simple it is. The only feature I feel it’s missing is the ability to set the length of the events on the calendar (or make them appear as “all day”). The default of an hour takes up a lot of space on a busy calendar.
]]>