Wordpress custom page type taxonomy pagination

Ok, I’ve done it. There must be a more graceful way to do this, but I’ve put this code in my functions.php file and it works …

$option_posts_per_page = get_option( ‘posts_per_page’ );
add_action( ‘init’, ‘my_modify_posts_per_page’, 0);
function my_modify_posts_per_page() {
add_filter( ‘option_posts_per_page’, ‘my_option_posts_per_page’ );
}
function my_option_posts_per_page( $value ) {
global $option_posts_per_page;
if ( is_tax( ‘portfolio-category’) ) {
return 2;
} else {
return $option_posts_per_page;
}
}

If anyone knows a better way to write this code please hook me up! Thanks. :slight_smile: