How to do paging in the loop?

Try adding ‘paged’ => get_query_var( ‘paged’ ) ? get_query_var( ‘paged’ ) : 1, // this will get the right posts for the current page (i.e. if the user loads www.domain.com/blog/page/2 directly) ‘posts_per_page’ => ‘6’ to your $args and delete showposts showpostsis deprecated. From the Codex reference for WP_Query: showposts (int) – number of posts to … Read more

Custom pagination code is not working

check below code for pagination. global $paged; $temp = $wp_query; $wp_query = null; $wp_query = new WP_Query( array(‘post_type’ => ‘post’,’posts_per_page’ => 2, ‘paged’ => $paged ) ); while (have_posts()) : the_post(); // Your post content. endwhile; echo paginate_links( $args ); global $wp_query; $big = 999999999; // need an unlikely integer echo paginate_links( array( ‘base’ => … Read more

Change permalink structure for pagination only

You could filter get_pagenum_link. The parameter has to be paged, not page then. add_filter( ‘get_pagenum_link’, ‘wpse_78546_pagenum_link’ ); function wpse_78546_pagenum_link( $link ) { return preg_replace( ‘~/page/(\d+)/?~’, ‘?paged=\1’, $link ); } But I would rather try to fix the broken rewrite rules.

Pagination on category.php and tag.php not working

If you merely want to modify posts_per_page for tag and category archive index pages, don’t use query_posts(); instead, filter the $query via pre_get_posts: function wpse87489_filter_pre_get_posts( $query ) { if ( ( is_category() || is_tag() ) && $query->is_main_query ) { $query->set( ‘posts_per_page’, ‘2’ ); } } add_action( ‘pre_get_posts’, ‘wpse87489_filter_pre_get_posts’ );

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.