Using this code in the functions.php
file to limit the number of results on Search pages and Blog Category pages, yet when viewing /page/2/
etc. for the Blog Category pages, they are throwing a 404.
//For Increasing the number of posts on a search page
function limit_posts_per_archive_page() {
if ( is_category() )
$limit = 3;
elseif ( is_search() )
$limit = 12;
else
$limit = get_option('posts_per_page');
set_query_var('posts_per_archive_page', $limit);
}
add_filter('pre_get_posts', 'limit_posts_per_archive_page');
Is there something missing or implemented incorrectly with this?
query_posts()
and stuff). – Rarst Jul 4 '16 at 18:25