I've been building a theme from scratch so writing everything from nothing and every place I go online which teaches me how to implement pagination are mostly showing ways to make the standard Wordpress version into a style one.
I've also learnt there's about 3 different paginations (Prev/Next, Archive Pages, Page Break) and I assume these all require different codes.
At the moment I've successfully implemented the Prev/Next pages here:
This was achieved with:
<div class="postnav six columns droided-box prev clearfix"> <h2>Previous Post</h2> <?php previous_post_link('%link', '%title', FALSE); ?> </div> <div class="postnav six columns droided-box next clearfix"> <h2>Next Post</h2> <?php next_post_link('%link', '%title', FALSE); ?> </div>
I'm currently trying to add the pagination to the Archive.php page. Here's what I have for the archive page (ignore the title part, I've commented them out as I'm still deciding on the best way to enter it.
<?php get_header(); ?> <div class="container"> <?php get_template_part('dynbar','main'); ?> <div class="two-thirds column row droided-box droided-body droided-page"> <?php if ( have_posts() ) : ?> <h1>Posts from <?php // single_cat_title(); ?> </h1> <?php // if ( category_description() ) : ?> <?php // echo category_description(); ?> <?php // endif; ?> </div> <?php while ( have_posts() ) : the_post(); ?> <div class="two-thirds column row droided-box droided-body droided-item"> <h1><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"> <?php the_title(); ?> </a></h1> <?php the_post_thumbnail('featured'); ?> <?php echo excerpt(200); ?> <p class="top-meta">Written by <?php the_author_posts_link() ?> on <?php the_date(); ?> </p> <div class="post-meta"> <p> <?php comments_popup_link( 'No comments yet', '1 comment', '% comments', 'comments-link', 'Comments closed'); ?> </p> </div> <a class="read-more-droided" href="<?php the_permalink(); ?>">Continue Reading...</a> </div> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> </div> <?php endif; ?> <?php the_posts_pagination( array( 'mid_size' => 2, 'prev_text' => __( 'Back', 'droided' ), 'next_text' => __( 'Onward', 'droided' ), ) ); ?> <?php get_footer(); ?>
That's part of an archive page for June which lists a couple posts. Now I haven't entered any code in the functions.php in regards to pagination because I'm not sure if I need to because it's already wordpress core function right?
Is there a default cut off for archive pages which breaks the page because I haven't entered it anywhere.
My main question is how can I check to see if pagination is working and do I need to put anything in functions.php for the archive pagination to work, also is there a way to change the amount of posts the archive page to list before breaking to another page?