Skip to content

Instantly share code, notes, and snippets.

@amdrew
Created December 3, 2013 06:21
Show Gist options
  • Select an option

  • Save amdrew/7764705 to your computer and use it in GitHub Desktop.

Select an option

Save amdrew/7764705 to your computer and use it in GitHub Desktop.
Overwrite amount of downloads per category
<?php
function my_child_theme_filter_taxonomy( $query ) {
if ( is_admin() || ! $query->is_main_query() )
return;
if( $query->is_tax( 'download_category' ) ) {
$query->set( 'posts_per_page', 50 );
return;
}
}
add_action( 'pre_get_posts', 'my_child_theme_filter_taxonomy' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment