I've been looking around for a solution to displaying a separate amount of posts specifically for the archive pages, and thought I had came up with some working code, however I see it messes up pagination. Basically page 2 of the archive displays the same posts as the archive front page. Link: http://hvamgolfklubb.no/category/ukategorisert/
Code:
<?php
/* Sets the amount of posts to display for $querycat */
$querycat = new WP_Query( 'posts_per_page=4' ); ?>
<?php
/* Start the Loop */
while ( $querycat->have_posts() ) : $querycat->the_post(); /* Display $querycat amount of posts */
/* Include the post format-specific template for the content. If you want to
* this in a child theme then include a file called called content-___.php
* (where ___ is the post format) and that will be used instead.
*/
get_template_part( 'content', get_post_format() );
endwhile;
wpbeginner_numeric_posts_nav();
?>
Any help is appreciated. I know it's not the numeric pagination that messes up as it behaved like this before implementing that as well. I'm still quite new to PHP, but improving every day, so please do share a better solution if you know of any.
WP_Query
in codex.