Skip to content

Instantly share code, notes, and snippets.

@anythinggraphic
Last active May 8, 2019 16:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anythinggraphic/16779bb32aff4647c1882f46ba316ea6 to your computer and use it in GitHub Desktop.
Save anythinggraphic/16779bb32aff4647c1882f46ba316ea6 to your computer and use it in GitHub Desktop.
Add next/previous post links on Single Posts.
<?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