Help Desk

Query ongoing events only

  • Posts: 8 Topics: 3
    | Permalink

    Hey posted this on twitter and was directed here (which makes a lot of sense)

    Pretty much I need to query ongoing and single day events separately, I see in the docs you can check whether is/not ongoing but I can’t see any docs surrounding querying this directly.

    Current code (simple) is as follows: http://pastebin.com/1Q0u0z38

    Pretty much what I need is the proper syntax for

    $events = tribe_get_events(‘ongoing’ => ‘true’);

    Hope i’ve explained myself properly.

    Thanks

    Posts: 4278 Topics: 105 Answers: 467
    | Permalink

    Thanks for posting this, Liana. Makes perfect sense. Good question – that’s a bit outside my area of expertise but I’ve got our developer Jonah looking at it now; expect a response over the next 24 hours.

    Posts: 8 Topics: 3
    | Permalink

    I didn’t know whether to split off ask on this thread but new question.

    I need to grab the category name or ID for sorting purposes too, is there a tribe_get_category(); type function?

    I found tribe_meta_event_category_name() in the docs but the params seem to be from the url rather than being able to feed an ID directly into it.

    I have also looked through tribe_get_events / tribe_get_event_meta and neither return it.

    Any ideas?

    Posts: 4278 Topics: 105 Answers: 467
    | Permalink

    Got Jonah looking at this now. Thanks Liana 🙂

    Posts: 4021 Topics: 4 Answers: 763
    | Permalink

    Hi Liana,

    Have you tried using the tribe_is_multiday() function wrapped around your query? For example: http://pastebin.com/SUNPSidX

    Hopefully that helps.

    – Jonah