WordPress 404 pagination (/page/2) error?

Pagination cannot be reliably implemented in template. It is resolved during load way before template it ever reached. Unless you implement it from scratch (complete with rewrite) you need to be using pre_get_posts or other related hook to modify main query. Look around the site, there are plenty answer on topic of here.

Disable pagination on frontpage

Make use of the WordPress template hierarchy, by either having a home.php – home page – or a front-page.php – front page – to display the site home/front. Read the WordPress codex article Creating a Static Front Page for an insight on how to do it and some explanation about the differences. Do not use … Read more

Paginate Links function: Page 1 doesn’t work

The Base is the Problem: ‘base’ => add_query_arg(‘listpostspage’,’%#%’), Here ist the full code: $pagination_args = array( ‘base’ => add_query_arg(‘listpostspage’,’%#%’), ‘format’ => ‘?listpostspage=%#%’, ‘total’ => $the_query->max_num_pages, ‘current’ => $paged, ‘show_all’ => false, ‘end_size’ => 1, ‘mid_size’ => 2, ‘prev_next’ => true, ‘prev_text’ => __( ‘Zurück’, ‘Theme’ ), ‘next_text’ => __( ‘Weiter’, ‘Theme’ ), ‘type’ => ‘plain’, … Read more