TomLargeRawww of Rawww
7/25/2017 - 11:10 AM

Set post per page for taxonomys

Set post per page for taxonomys

function location_posts( $query ) {
    if( is_tax( 'location' ) ) { // Change to your tax
        $query->set('posts_per_page', '2');
    }
    return $query;
}
add_filter('pre_get_posts', 'location_posts');