Custom Taxonomy terms with latest post ordered by date pagination issue

to change the number of posts per page you can do it in the wp dashboard
like in this picture

This function on functions.php works for me

function tcPostsPerPage( $query ) {
  if (is_home()){$query->set('posts_per_page', 6);}
  if (is_archive()){$query->set('posts_per_page', 6);}
}
add_action( 'pre_get_posts', 'tcPostsPerPage' );

the two 6 is limiting to 6 per page, if this doest work for you, its a question of changing the is_archive() to something like is_page(‘yourpage’)

also if it works you can remove the ‘posts_per_page’ of your array, and the variable attached.

Leave a Comment