Home › Forums › Calendar Products › Events Calendar PRO › Can't increase number of events in loop
- This topic has 5 replies, 2 voices, and was last updated 11 years, 6 months ago by Jonah.
-
AuthorPosts
-
October 25, 2012 at 8:04 am #27188AndersonParticipant
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
October 25, 2012 at 8:36 am #27191JonahParticipantHi 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
October 25, 2012 at 9:40 am #27201AndersonParticipantNot sure why but this still isn’t working. It’s determined to show 10 events.
October 25, 2012 at 1:45 pm #27218JonahParticipantStrange, what is your permalink structure set to? Try setting it to Postname. Does changing the setting in Settings > Reading do anything?
– Jonah
October 26, 2012 at 5:35 am #27235AndersonParticipantThat 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.
October 26, 2012 at 8:07 am #27241JonahParticipantHi 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
-
AuthorPosts
- The topic ‘Can't increase number of events in loop’ is closed to new replies.