Another quick WordPress tip for you guys. I found myself needing the code to return just the url value of the previous or next single post. For some reason there doesn’t seem to be a simple way to do it, however, I did stumble across the following codes.
Previous link:
<?php echo get_permalink(get_adjacent_post(false,'',false)); ?>
Next link:
<?php echo get_permalink(get_adjacent_post(false,'',true)); ?>
So there you have it, that’s how you can return the previous and next single post links!