Created
July 24, 2017 09:21
-
-
Save gabrielizalo/516e529e50e9ad2702cdb836e3618a82 to your computer and use it in GitHub Desktop.
Wordpress - Post Archive Pagination
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' => __( '« Go Back', 'textdomain' ), // Previous Posts text. | |
'next_text' => __( 'Move Forward »', 'textdomain' ), // Next Posts text. | |
) ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment