tribe_get_events template tag

Home Forums Calendar Products Events Calendar PRO tribe_get_events template tag

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #10119
    Kevin
    Member

    is it possible to get an example of this function:
    tribe_get_events
    with all the args filled in? Just to know the exact syntax for querying events?

    #10121
    Kevin
    Member

    never mind, got it sorted, but one thing, is there any way to filter events by recurring/ non recurring?

    #10214
    Rob
    Member

    Hey Kevin. Glad to see you got the first issue resolved. There’s no way to do that on the frontend, unfortunately…you can separate between the two on the backend but nothing along those lines on the public-facing side. You could possibly hack something like that together, but I’m afraid I can’t offer up more than that.

    #10303
    slny311
    Participant

    Hey Kevin, can you post your code?

    #10312
    Kevin
    Member

    Hi slny311

    I found out that tribe_get_posts() is a wrapper around wordpress’ get_posts() function, so you can see all the parameters here:
    http://codex.wordpress.org/Template_Tags/get_posts
    http://codex.wordpress.org/Function_Reference/get_post

    it adds the post_type of tribe_events and sorted by ascending date by default.

    on a second note, to filter repeating events ( I was only after weekly events) I added this to my parameters in the query:
    ‘post_name’ => ‘weekly-events’

    I hope that helps!

    #10313
    slny311
    Participant

    Hey Kevin thank for the reply, im new and still learning wp

    i am trying to change the featured widget to show only todays events…

    so in the widget-featured.class.php file i replaced

    $posts = tribe_get_events( ‘numResults=1&eventCat=’ . $category);

    with below and its not showing anything…

    $today = getdate();

    $query = new WP_Query( ‘year=’ . $today[“year”] . ‘&monthnum=’ . $today[“mon”] . ‘&day=’ . $today[“mday”] );

    $posts = tribe_get_events( ‘numResults=1&eventCat=’ . $category . $today);

    Any thoughts would be appreciated…

    #10314
    Kevin
    Member

    Hi slny311,

    in your tribe_get_events query you are trying to concatenate a date with a category which won’t work.
    get_posts does not have a ‘date’ parameter so your not going to be able to use that.

    Just of the top of my head I would get today’s date, and then run a conditional to see if the date of the post is equal to today’s date and if so, then display the post.

    something like if (the_date() == $today) {
    do this….
    }

    you’ll have to google around to see how to write this correctly.

    Hope that helps!

    #10315
    slny311
    Participant

    thanks kevin… lol.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘tribe_get_events template tag’ is closed to new replies.