Display events in RSS feed ordered by date posted

Home Forums Calendar Products Events Calendar PRO Display events in RSS feed ordered by date posted

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #841458
    aehhub
    Participant

    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….

    #843837
    Brian
    Keymaster

    Hello,

    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)

    http://www.yoursite.org/feed/

    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

    #844052
    aehhub
    Participant

    Hello 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?

    #844287
    Brian
    Keymaster

    Ok 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

    #907026
    Brian
    Keymaster

    Since 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! 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Display events in RSS feed ordered by date posted’ is closed to new replies.