Why using a function to create variable post numbers breaks paging?
-
I’m using a function to create variable post numbers on the homepage of my site and the categories pages of my site. When employing this function, it seems to break the prev/next arrows in my pagination. The numbers still work but the arrows don’t.
This is the code I’m using:
function limit_posts_per_page() {
if ( is_category() )
return 12;
else
return 13; // default: 13 posts per page
}
add_filter('pre_option_posts_per_page', 'limit_posts_per_page');
- The topic ‘Why using a function to create variable post numbers breaks paging?’ is closed to new replies.