Created
September 15, 2012 16:46
-
-
Save claudiosanches/3728779 to your computer and use it in GitHub Desktop.
Custom posts per page for Taxonomy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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