Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Created November 16, 2012 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jo-snips/4088946 to your computer and use it in GitHub Desktop.
Save jo-snips/4088946 to your computer and use it in GitHub Desktop.
The Events Calendar: Modify Posts Per Page in Day View
add_action( 'pre_get_posts', 'change_post_count_in_day_view' );
function change_post_count_in_day_view( $query ) {
if ( $query->query_vars['eventDisplay'] == 'day' && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set('posts_per_page', 1);
}
return $query;
}
@jo-snips
Copy link
Author

Add this to your themes functions.php file to change the number of posts displayed in day view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment