Skip to content

Instantly share code, notes, and snippets.

@carasmo
Last active February 23, 2016 13:14
Show Gist options
  • Save carasmo/70a4fd9cc27d5822e03a to your computer and use it in GitHub Desktop.
Save carasmo/70a4fd9cc27d5822e03a to your computer and use it in GitHub Desktop.
Paginate author page: goes in your child theme functions.php file (you can use other conditions, such as `if (!is_admin() && is_archive( 'name-of-cpt' ) )` for pagination on Custom Post Types.
<?php
//don't include this
function author_posts_per_page( $query ) {
if (!is_admin() && is_author() )
$query->set( 'posts_per_page', 5 );
}
add_filter('parse_query', 'author_posts_per_page');
@carasmo
Copy link
Author

carasmo commented Feb 23, 2016

Well, I thought ticks would work for the description field, anyway:
if (!is_admin() && is_archive( 'name-of-cpt' ) )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment