• Resolved Almudenita11

    (@almudenita11)


    Hi,
    I would like to add a page in this site (www.demidenko.net), with just the 2017 events.

    I have tried adding this code in the page but it does not work, Could you help me?

    // Retrieve all events in 2017
    $events = tribe_get_events( array(
    ‘eventDisplay’ => ‘custom’,
    ‘start_date’ => ‘2017-01-01 00:01’,
    ‘end_date’ => ‘2017-12-31 23:59’
    ) );

    Thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hey there @almudenita11!

    Thanks for reaching out.

    There is no built in functionality to show events from only one year. The easiest way would be to link to a URL like this that has the date limitations →
    https://demidenko.net/events/?tribe_paged=1&tribe_event_display=list&tribe-bar-date=2017-01-01 — this won’t just show the events for that year though, it will show events since that start date.

    To make The Events Calendar show only the year, I’d suggest using tribe_get_events helper function.

    Take care,
    Ed ??

    Thread Starter Almudenita11

    (@almudenita11)

    The point is that I have tried to insert the functions in a new page:
    https://demidenko.net/season-2017-2018/

    Using the former function, but It doesn’t work, but I do not know why.

    // Retrieve all events in 2017
    $events = tribe_get_events( array(
    ‘eventDisplay’ => ‘custom’,
    ‘start_date’ => ‘2017-01-01 00:01’,
    ‘end_date’ => ‘2017-12-31 23:59’
    ) );

    So, I may do something wrong…

    Sorry, I must have misunderstood your question.

    When you say that you added the code to the page, do you mean inside the event editor?

    That code being PHP, needs to go into PHP file like a page templates, then you can select that template to use for the actual page that you created.

    Hope that helps!

    Hey there,

    Since this thread has been inactive for a while, I’m going to go ahead and mark it as resolved. Don’t hesitate to create a new thread any time you help again!

    Ed ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Organizace events by years’ is closed to new replies.