Skip to content

Instantly share code, notes, and snippets.

@jo-snips
Created November 16, 2012 16:55
Show Gist options
  • Select an option

  • Save jo-snips/4088946 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown
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