How to create a static page with all upcoming events

Home Forums Calendar Products Events Calendar PRO How to create a static page with all upcoming events

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #991874
    Devashish
    Participant

    Hi,

    Can you please help in creating a static Page. The intention is to have a static page that displays all events similar to the URL: post_type=tribe_events

    Thanks!
    Devashish

    #992072
    Barry
    Member

    Hi Devashish,

    Great question – though please note that we are unable to go into too much depth for custom development issues.

    That said, utilizing our tribe_get_events() function (which accepts many of the same arguments as does get_posts()) would be an easy way to obtain the list, using code looking something like this:

    $event_list = tribe_get_events( array( 
        'eventDisplay'   => 'list',
        'posts_per_page' => -1
    ) );
    
    foreach ( $event_list as $event ) {
        echo "
            <p> {$event->post_title} 
                {$event->EventStartDate} </p>
        ";
    }

    Of course, you would need to expand on that to fit your exact needs (also, this third party plugin – which we don’t support here – provides a shortcode to let you do things like this, if you prefer that sort of approach).

    I hope that gets you started – and good luck!

    #992075
    Barry
    Member

    …Last but not least – be aware that if you have a large number of events, querying for them all en masse like this may pose some performance issues and in some cases might even result in a timeout before the query can complete.

    #992495
    Devashish
    Participant

    Thanks for the reply,

    Regards,
    Devashish

    #992684
    Barry
    Member

    My pleasure 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to create a static page with all upcoming events’ is closed to new replies.