Pagination for custom query throws 404 errors on last pages [duplicate]

Exactly what @Pieter Goosen said. Not only are you creating havoc for WordPress, you’re adding unnecessary load on the server by introducing more queries on top of the main query: function wpse_176933_custom_authors_archive( $wp_query ) { if ( $wp_query->is_main_query() && $wp_query->is_author() ) { $wp_query->set( ‘posts_per_page’, 4 ); $wp_query->set( ‘post_type’, ‘publikasjoner’ ); $wp_query->set( ‘meta_key’, ‘rapportnummer’ ); $wp_query->set( … Read more

Plugin to show pagemap beneath certain page and next/previous page beneath certain page?

This will get you the parent page ID: $post->post_parent ..and this will get that parent page’s children: get_children($post->post_parent); By default that will return an object. You can then play about with that object to your heart’s content, including making a navigation of sorts. Something like this to get started: <ul> <li class=”heading”><?php get_title($post->post_parent); ?></li> <?php … Read more