Skip to content

Instantly share code, notes, and snippets.

/functions.php Secret

Created November 24, 2013 16:13
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/9e7716a006667a667432 to your computer and use it in GitHub Desktop.
Save anonymous/9e7716a006667a667432 to your computer and use it in GitHub Desktop.
<?php
function itsme_editions_ppp( $query ) {
if( $query->is_category() && $query->is_main_query() ) {
if( !$query->is_paged() ) {
$query->set( 'posts_per_page', 10 );
} else {
$query->set( 'offset', 10 );
$query->set( 'posts_per_page', 15 );
}
}
}
add_action( 'pre_get_posts', 'itsme_editions_ppp' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment