Created
December 2, 2015 13:23
-
-
Save fovoc/4d00412a4edca362adef to your computer and use it in GitHub Desktop.
Shoestrap 3 - add previous/next links in the bottom of single posts
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
| <?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