Skip to content

Instantly share code, notes, and snippets.

@gabrielizalo
Created July 24, 2017 09:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabrielizalo/516e529e50e9ad2702cdb836e3618a82 to your computer and use it in GitHub Desktop.
Save gabrielizalo/516e529e50e9ad2702cdb836e3618a82 to your computer and use it in GitHub Desktop.
Wordpress - Post Archive Pagination
// Taken from: https://speckyboy.com/wordpress-snippets-secondary-navigation/
/*
While many WordPress themes have a simple back and forth navigation for post archives, it’s a nice touch to add individual page numbers to the mix. It allows for navigating to a specific page and also gives the user a sense of your content depth.
Note the 'mid_size' argument in the code above. The number placed there will determine the amount of pages seen between the Next and Previous text links.
*/
<?php
the_posts_pagination( array(
'mid_size' => 5, // The number of pages displayed in the menu.
'prev_text' => __( '&laquo; Go Back', 'textdomain' ), // Previous Posts text.
'next_text' => __( 'Move Forward &raquo;', 'textdomain' ), // Next Posts text.
) );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment