Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Created March 17, 2015 16:46
Show Gist options
  • Save eri-trabiccolo/5bb8a78caa875c8cf187 to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/5bb8a78caa875c8cf187 to your computer and use it in GitHub Desktop.
make pagination really work in static front pages
add_action('pre_get_posts', 'pagination_home');
function pagination_home( $query ){
if ( $query -> is_main_query() && is_page() && $query->get( 'page_id' ) == get_option( 'page_on_front' ) && $query->get('page') )
$query -> set('paged', $query->get('page') );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment