Skip to content

Instantly share code, notes, and snippets.

@claudiosanches
Created September 15, 2012 16:46
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 claudiosanches/3728779 to your computer and use it in GitHub Desktop.
Save claudiosanches/3728779 to your computer and use it in GitHub Desktop.
Custom posts per page for Taxonomy
<?php
/**
* Custom posts per page for Taxonomy
*/
function cs_custom_posts_per_page( $query ) {
if ( is_tax( 'Categorias' ) ) {
$query->query_vars['posts_per_page'] = 1;
return;
}
}
add_filter( 'pre_get_posts', 'cs_custom_posts_per_page' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment