1 have a problem with “extra” pages after going from one post per page to several post per page in blog. This meant that number of pages with content went down from 64 to 32. But in my pagination the last number of pages is still 64.
I simply do not know what to do…without accidentaly breaking the whole site to pieces 🙂
Thank you for fast reply. I have tried to deactive plugins, and did so again now. Still the same problem.
But I noticed something that I missed before. When I click on the navigation for example on page two, then the number of total pages goes to the true number – 34. This keeps on. But when I go to the front page, then the total number shows up as 64.
Very strange. I think I choose a cheap solution and remove the total number box..
This is the culprit:
function limit_posts_per_page() {
if ( is_home() && is_paged() )
return 6;
else
return 3;
}
add_filter (‘pre_option_posts_per_page’, ‘limit_posts_per_page’);
The function multiplies the actual number of pages with two. It doubles the total number of pages. I’ll work on this to try to understand (and solve it). It is obviously not at Generatepress fault.
A while ago you gave med a function that worked, but it affected the adminpages with list of posts, too. First page of list contained three posts.
add_action( ‘pre_get_posts’, ‘tu_change_posts_per_page’, 1 );
function tu_change_posts_per_page( &$query ) {
if ( ! is_main_query() ) {
return;
}