Home › Forums › Calendar Products › Events Calendar PRO › RSS feed wrong time
- This topic has 9 replies, 3 voices, and was last updated 10 years, 9 months ago by
Leah.
-
AuthorPosts
-
December 30, 2014 at 6:41 am #926687
Frederique
ParticipantI already discovered some of the same issues, but can’t figure out how to get it working. Where do I change the code?
And do I need to change it everytime during winter and summer?
December 30, 2014 at 8:18 am #926779Geoff
MemberHi there, Frederique! Thanks for reaching out and sorry you’re bumping into some problems with the event times in RSS.
I do see that we have a ticket logged for this issue and are working on it for an upcoming release. In the meantime, you can try adding this snippet to your theme’s functions.php file:
add_filter( 'get_post_time', 'events_rss2_gmt_pubdate_correction', 20 , 3 ); function events_rss2_gmt_pubdate_correction($time, $d, $gmt) { global $post; // Don't interfere if this is not the events feed if ( $post->post_type != TribeEvents::POSTTYPE || ! is_feed() || ! $gmt ) return $time; // Don't interfere if the timezone hasn't been set $zone = get_option( 'timezone_string', false ); if ( false === $zone ) return $time; // Get time and timezone $time = new DateTime( tribe_get_start_date( $post->ID, false, $d ) ); $zone = new DateTimeZone( $zone ); // Apply timezone and calculate offset $time->setTimezone( $zone ); $offset = $zone->getOffset( $time ); $offset *= -2; // Apply correction $time->modify( "$offset seconds" ); $time = $time->format( TribeDateUtils::DBDATETIMEFORMAT ); $time = mysql2date( $d, $time ); return $time; }In most cases, you can paste snippets like this at the very bottom of the functions.php file. You can locate your functions.php file either in your theme directory files, or by logging into WordPress and heading over to Appearance > Editor and selecting the “Theme Functions” link from the right sidebar.
Give that a shot and let me know if it helps. 🙂
Cheers!
GeoffJanuary 5, 2015 at 10:05 am #928871Geoff
MemberHi there, Frederique! Just checking in to see if there’s been any other update or if you still need assistance on this one–please let me know. 🙂
Cheers!
GeoffJanuary 12, 2015 at 11:54 pm #931878Frederique
ParticipantHi,
Finally I got the time (and the right mindset) to try to solve the issue. When I try to post the code, I get an error when trying to reed the rss.
This page contains the following errors: error on line 24 at column 12: Extra content at the end of the document Below is a rendering of the page up to the first error.So I deleted the code as well.
The strange thing is: on the website it turns out to be great, but in the app, where the rss is loaded, it goes wrong.
Is there a way to get the featured images in the rss as well?January 13, 2015 at 8:38 am #932064Geoff
MemberHey Frederique! Thanks for following up.
Sorry the snippet is giving you some trouble. I just tried it out on my local site and it seems to work smoothly, so it’s likely that it needs to be placed elsewhere in your theme’s functions.php file so it doesn’t conflict with the formatting of other functions.
I think it would be possible to include the Featured Image in the Event RSS Feed, but I’m afraid it will take some custom development to get it going. There is a tutorial on how to add Events to your site’s main RSS Feed that might help get you started, but it’s unfortunately something that isn’t supported out of the box.
Please let me know if you have any other follow-up questions. 🙂
Cheers!
GeoffJanuary 19, 2015 at 9:54 am #934780Geoff
MemberHey there, Frederique! Just checking in to see if you had any additional follow-up questions or still need assistance on this one–please let me know. 🙂
Cheers!
GeoffJanuary 22, 2015 at 8:36 am #936220Geoff
MemberBy the way, one of my colleagues here on the team came up with a snippet that might help address the RSS feed time issue you’ve been having. Give this a shot and let us know if it helps make a difference.
https://gist.github.com/geoffgraham/97066b8915f588aa0fad
Cheers!
GeoffJanuary 24, 2015 at 3:57 am #937052Frederique
ParticipantYeah, this works! I had to change the -7 into -1, but it works 🙂
January 26, 2015 at 7:19 am #937577Geoff
MemberThat is awesome! I’m glad that did the trick. 🙂
I’ll go ahead and close this thread but please feel free to start a new one if anything else comes up and we’d be happy to help.
Cheers!
GeoffJuly 20, 2015 at 12:36 pm #988056Leah
MemberHello,
Thank you again for bringing this issue to our attention. We’re happy to say that we have added a fix for this into our upcoming version 3.11 release. Keep an eye on your Updates page for the new version. If you have any trouble with the update (or are still seeing this problem after you update) please start a new thread and we’d be happy to help out.
Thank you for your patience while we got this release ready to go!
Best,
Leah
and the rest of The Events Calendar team -
AuthorPosts
- The topic ‘RSS feed wrong time’ is closed to new replies.
