Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wpse31701_filter_query() {
- global $wp_query;
- // Check year and month
- $wp_query->set('orderby', 'date'); $wp_query->set('order', 'ASC');
- if ( $wp_query->get( 'year' ) == 2005 and $wp_query->get( 'monthnum' ) == 4 )
- // Check page number to apply offset
- if ( $wp_query->get( 'paged') == 2 ) $wp_query->set( 'offset', 1 );
- else
- if ( $wp_query->get( 'paged') == 3 ) $wp_query->set( 'offset', 4 );
- else
- $wp_query->set( 'posts_per_page', 1);
- }
- add_action( 'pre_get_posts', 'wpse31701_filter_query' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement