Skip to content

Instantly share code, notes, and snippets.

@fovoc
Created December 2, 2015 13:23
Show Gist options
  • Save fovoc/4d00412a4edca362adef to your computer and use it in GitHub Desktop.
Save fovoc/4d00412a4edca362adef to your computer and use it in GitHub Desktop.
Shoestrap 3 - add previous/next links in the bottom of single posts
<?php
add_action( 'shoestrap_in_article_bottom', 'custom_prev_next_links' );
function custom_prev_next_links() {
$prev_post = get_previous_post();
$next_post = get_next_post();
if (!empty( $prev_post )) {
echo '<a class="pull-left" href="'. get_permalink( $prev_post->ID ) .'"><<< '. $prev_post->post_title .'</a>';
}
if (!empty( $next_post )) {
echo '<a class="pull-right" href="'. get_permalink( $next_post->ID ) .'">'. $next_post->post_title .' >>></a>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment