Skip to content

Instantly share code, notes, and snippets.

@derweili
Last active May 11, 2016 08:34
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 derweili/d201aaaef1f252ef759a1b9d23ec62f5 to your computer and use it in GitHub Desktop.
Save derweili/d201aaaef1f252ef759a1b9d23ec62f5 to your computer and use it in GitHub Desktop.
Modify main query pased on taxonomy - wordpress
function derweili_change_postnumber_imagegallerycat( $query ) {
if ( $query->is_main_query() && $query->is_tax('bildergalerien-kategorie') ) {
$query->set('posts_per_page', 50);
return;
}
}
add_action( 'pre_get_posts', 'derweili_change_postnumber_imagegallerycat' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment