Last active
May 8, 2019 16:10
-
-
Save anythinggraphic/16779bb32aff4647c1882f46ba316ea6 to your computer and use it in GitHub Desktop.
Add next/previous post links on Single Posts.
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 | |
/* Add next/previous post links on single posts | |
----------------------------------------------------------------------------------------*/ | |
add_action( 'genesis_before_comments', 'ag_prev_next_post_nav' ); | |
function ag_prev_next_post_nav() { | |
if ( is_singular( 'post' ) ) { | |
echo '<div class="prev-next-navigation">'; | |
echo '<div class="wrap no-padding-vertical">'; | |
echo '<div class="one-half first true align-right">'; | |
previous_post_link( '<div class="previous"><span class="caps pre-title">Previous Post</span> %link</div>', '%title' ); | |
echo '</div>'; | |
echo '<div class="one-half true">'; | |
next_post_link( '<div class="next"><span class="caps pre-title">Next Post</span> %link</div>', '%title' ); | |
echo '</div>'; | |
echo '</div>'; | |
echo '</div>'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment