3200creative
1/29/2014 - 6:13 PM

Post limit in specific WP category

Post limit in specific WP category

//* Limit posts for specific category archive
add_filter('pre_get_posts', 'limit_posts_per_archive_page');
function limit_posts_per_archive_page() {
	 if( is_category(array(2,18))) {
		set_query_var('posts_per_archive_page', 20);
	}
}