Archived topic
Removing pagination
10 replies · Started by Vinay on October 8, 2018
By default pagination is shown on front page, categories, tags, etc like 1 2 ... 76 Next. How it can be removed from front/home page using php.
Hi there,
so would you want infinite scroll scroll on the front page?
No i don't want infinite scroll
So the front page will display a limited number of posts or all of them?
Sorry just need to know so we can provide the best solution.
Yes just lastest few say 10 posts
Any one please reply
Hi there,
Try this function:
add_action( 'wp', function() {
if ( is_front_page() ) {
add_filter( 'generate_show_post_navigation', '__return_false' );
}
} );
This function work on generatepress 2.x but not in 3.x. will work in 3.x.x?
Looks like you've discovered a bug and we've fixed that in the next Alpha version:
https://github.com/tomusborne/generatepress/commit/8cb4f2590eb760be9a1ac8c71736a2455080aab6
Thanks!!
The filter that still works for me in version 3.0 is this one:
add_filter( 'generate_show_post_navigation', '__return_false' );
Thanks for letting us know - the bug was patched before the final release :)