Forked from hasinhayder/wp_adjacent_posts_links.php
Last active
August 29, 2015 14:07
-
-
Save asifsaho/32f6f25612bd654f737b 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 | |
function tb_get_previous_post_link(){ | |
global $post; | |
$prev_link = ""; | |
$prev_post = get_previous_post(); | |
if($prev_post){ | |
$prev_link = get_the_permalink($prev_post->ID); | |
} | |
return $prev_link; | |
} | |
function tb_get_next_post_link(){ | |
global $post; | |
$next_link = ""; | |
$next_post = get_next_post(); | |
if($next_post){ | |
$next_link = get_the_permalink($next_post->ID); | |
} | |
return $next_link; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment