Problem with recurring events get_posts loop (event time and url wrong)

Home Forums Calendar Products Events Calendar PRO Problem with recurring events get_posts loop (event time and url wrong)

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #24452
    Sandro
    Participant

    Hi,

    I’m trying to make a widget that displays 4 upcoming events. Kind of a widget if you like. It works perfectly for normal events, but with recurring events links are wrong and time displayed is incorrect. Please see screenshot to understand it better:

    http://imageshack.us/f/11/screenshot20120902at120.png/

    Uppor (green) section is normal events and everything works fine.
    But lower section we have recurring events, notice start date and time, they are all the same… they should increment 1 day since I did recurring event for a week everyday.

    Code I’m using is this: http://pastebin.com/raw.php?i=y5kCdbFY

    Any hints or ideas would be appreciated!

    ty!

    #24494
    Jonah
    Participant

    Hi Sandro,

    The first thing I would recommend is to not use get_posts and use tribe_get_events() instead. We have examples of queries in our documentation and you should easily be able to modify your existing query: https://theeventscalendar.com/support/documentation/the-events-calendar-template-tags-general-functions/#functiontribe_get_events

    Try switching to using that instead and let me know how it goes.

    Cheers,
    Jonah

    #25171
    Sandro
    Participant

    Is there a way to display them orderby comment count?

    #25201
    Jonah
    Participant

    I don’t think tribe_get_events() will work with any of the orderby args because it needs to do it’s own ordering by date. If you want to use the orderby comment_count arg, you should probably use WP_Query.

    I hope that helps!

    – Jonah

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Problem with recurring events get_posts loop (event time and url wrong)’ is closed to new replies.