Skip to content

Instantly share code, notes, and snippets.

Created May 30, 2013 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5678783 to your computer and use it in GitHub Desktop.
Save anonymous/5678783 to your computer and use it in GitHub Desktop.
/** Pagination on home page */
add_action( 'pre_get_posts', 'child_change_home_query' );
/** Changes the query on the home page*/
function child_change_home_query( $query ) {
if( $query->is_main_query() && $query->is_home() ) {
$query->set( 'posts_per_page', '10' );//change to the posts setting for your widget
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment