posts_per_page in query doesn't match
-
Hello,
When we are using posts_per_page in query_posts or WP_query, the navigation doesn’t match the request number of post, but based on the setting reading number of posts. This is kind of annoying when we using difference of number of post depending of the template page used.
To prevent this problem I am using that for now:
function custom_posts_per_page( $query ) {
if ( is_category(4) ) {
set_query_var('posts_per_page', 5);
}
}
add_action( 'pre_get_posts', 'custom_posts_per_page' );
Anyway, thank you for your work on WordPress, this is a great platform to work on.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘posts_per_page in query doesn't match’ is closed to new replies.