Created
November 16, 2012 16:55
-
-
Save jo-snips/4088946 to your computer and use it in GitHub Desktop.
The Events Calendar: Modify Posts Per Page in Day View
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this to your themes functions.php file to change the number of posts displayed in day view.