Can't increase number of events in loop

Home Forums Calendar Products Events Calendar PRO Can't increase number of events in loop

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #27188
    Anderson
    Participant

    I’m having a problem getting more than 10 events to show on the default events list page. I have gone into the plugin settings under “General” and have changed the number of events to 20 under “Number of events to show per page in the loop” but it has no impact. I have also looked at list.php and there doesn’t seem to be anything in the theme file that’s controlling the number of events. Any suggestions are appreciated. Thanks

    #27191
    Jonah
    Participant

    Hi Krysia,

    Sometimes your theme will override the setting for the plugin. You can take control by placing this in your themes functions.php file and modifying the posts_per_page to however many events you want to show:

    //show more events on the events list pages
    add_action( 'pre_get_posts', 'set_events_per_page' );
    function set_events_per_page( $query ) {
    if ( $query->query_vars['eventDisplay'] == 'upcoming' || $query->query_vars['eventDisplay'] == 'past' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
    $query->set('posts_per_page', 2);
    }
    return $query;
    }

    I hope that helps but let me know if you need anything else.

    – Jonah

    #27201
    Anderson
    Participant

    Not sure why but this still isn’t working. It’s determined to show 10 events.

    #27218
    Jonah
    Participant

    Strange, what is your permalink structure set to? Try setting it to Postname. Does changing the setting in Settings > Reading do anything?

    – Jonah

    #27235
    Anderson
    Participant

    That doesn’t work either. If there’s anything else you can think of let me know, otherwise I’ll do some more work on my end soon, and will share what the solution was when I figure it out.

    #27241
    Jonah
    Participant

    Hi Krysia,

    I would suggest deactivating all other plugins and try reverting your theme to Twenty Eleven to see if it’s something with your theme that’s overriding this setting. If it is in your theme you’ll need to dig through and figure out what it is. Good luck and let us know what you find!

    – Jonah

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Can't increase number of events in loop’ is closed to new replies.