Too many events? Page goes blank

Home Forums Calendar Products Events Calendar PRO Too many events? Page goes blank

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1117363
    Ingo Recher
    Participant

    Hello,
    i have the following problem. By now we habe 2.211 events in our database. When i want to loop through them with the following code, the page goes blank:

    $po_all_events = tribe_get_events( array(
        'posts_per_page' => -1,
        'start_date' => current_time( 'Y-m-d' ),
    ) );
    
    global $post;	
    foreach ( $po_all_events as $post ) {
        setup_postdata( $post );
        …
    }

    If i change ‘posts_per_page’ to 2050 the page comes up again fine.

    Is there a maximum of events the plugin can handle?

    Thanks in advance!
    Manu

    #1117503
    Cliff
    Member

    Hi Manuel. Thanks for your question regarding tribe_get_events().

    There is definitely not a limit set by us. However, your site, server, PHP settings, etc may affect your site’s performance.

    Regarding this piece of your code:

    global $post; foreach ( $po_all_events as $post ) { setup_postdata( $post );

    It seems global $post; is unnecessary (or needs to be moved elsewhere) because it gets overwritten by the foreach.

    I hope something here helps you.

    #1122752
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Too many events? Page goes blank’ is closed to new replies.