Hi @manavkalra15,
Here is a CSS code you may try adding through Appearance > Customize > Additional CSS:
a.page-numbers:not(.next):not(.prev), span.page-numbers {
display: none;
}
Hope this helps! 🙂
I don’t want to use css , I want to completely remove numbers from html and want to only show next and prev for pagination.
This is controlled by WordPress. They have a filter for it paginate_links_output.
Reference: https://developer.wordpress.org/reference/hooks/paginate_links_output/
It would be best to reach out to their forums regarding this: https://wordpress.org/support/forum/wp-advanced/
Side note: GP Premium also has a functionality to create custom Paginations.
Hope this clarifies. 🙂
Can you tell me how to remove total pages from pagination, its currently like this
1 2 … 1,846 Next → , I want this like 1 2 … Next → will also work , Mainly I want to hide total number of pages completely from html code.
Hi there,
add this PHP Snippet to your site:
add_action('wp',function(){
remove_action( 'generate_after_loop', 'generate_do_post_navigation' );
});
add_action( 'generate_after_loop', function() {
echo '<div class="paging-navigation">';
posts_nav_link( ' ', '← Previous', 'Next →' );
echo '</div>';
});
-
This reply was modified 3 years, 11 months ago by
David.