Last active
December 18, 2015 08:39
-
-
Save gyrus/5755961 to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
/** | |
* Custom blog pagination links | |
* | |
* @return void | |
*/ | |
function pilau_posts_nav_link() { | |
global $wp_query; | |
$max_num_pages = $wp_query->max_num_pages; | |
$paged = get_query_var( 'paged' ); | |
if ( $max_num_pages > 1 ) { | |
echo '« ' . get_next_posts_link( __( 'Older posts' ) ); | |
if ( $paged > 1 && $paged < $max_num_pages ) { | |
echo ' | '; | |
} | |
echo get_previous_posts_link( __( 'Newer posts' ) ) . ' »'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment