Created
March 17, 2015 16:46
-
-
Save eri-trabiccolo/5bb8a78caa875c8cf187 to your computer and use it in GitHub Desktop.
make pagination really work in static front pages
This file contains 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', '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