Home › Forums › Calendar Products › Events Calendar PRO › Display events in RSS feed ordered by date posted
- This topic has 4 replies, 2 voices, and was last updated 9 years, 5 months ago by Brian.
-
AuthorPosts
-
October 27, 2014 at 11:58 am #841458aehhubParticipant
Hello,
I followed the instructions on this page
https://theeventscalendar.com/how-to-add-events-to-your-rss-feed/And the Events are displayed in my main blog loop but they’re ordered by the event date, not the posted date.
I added this to the functions file:
add_action( ‘pre_get_posts’, ‘maybe_teardown_tribe_order_filter’, 60 );
function maybe_teardown_tribe_order_filter() {
if ( is_feed() ) remove_filter( ‘posts_orderby’, array( ‘TribeEventsQuery’, ‘posts_orderby’ ), 10, 2 );
}Not sure what I’m doing wrong….
October 28, 2014 at 7:53 am #843837BrianKeymasterHello,
Sorry for the issues you are having with this. I can help troubleshoot it with you.
I loaded the coding on my test site and it appears to be working for me.
So lets see what is different about your site.
I visited the feed here: (changed the url on purpose)
And it looked to be ordered by publication date.
The first event is “Test news again”
Is that not what you are seeing?
Let me know and we can go from there.
Thanks
October 28, 2014 at 9:16 am #844052aehhubParticipantHello Brian,
The items in the RSS structure are ordered by when they were posted, but the pubdate – which is what feed readers like Feedly or Mailchimp for RSS newsletters use – is the event date. So the Animals conference has the pubdate 12 Jul 2015 – that’s next year, so it’s always on top in Feedly or in MailChimp newsletters made from the RSS feed.
Does that explanation make sense?
October 28, 2014 at 10:42 am #844287BrianKeymasterOk I see what you are trying to do.
I tried to duplicate what you said about the pubdate, but in my feed, Feedly ignored it and the order was the publish order even though the pudate was the eventdate.
So not sure why it is different for you.
Anyway if you add this to remove the filter the Events Calendar in your theme’s function.php it should work:
https://gist.github.com/jesseeproductions/121e4434b8ed6e23e889
You may have to modify it with some more conditionals you can find those here:
https://gist.github.com/jo-snips/2415009
Thanks
December 3, 2014 at 6:01 pm #907026BrianKeymasterSince I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂
-
AuthorPosts
- The topic ‘Display events in RSS feed ordered by date posted’ is closed to new replies.