Return to Snippet

Revision: 66340
at April 21, 2014 18:54 by fedek6


Initial Code
<!-- prev post in category -->
	<?php $prev = get_permalink(get_adjacent_post(false,'',false)); 
		if($prev != get_permalink()) { ?><a id="navi-left" href="<?php echo $prev; ?>"></a><?php } ?>
	
<!-- next post in category -->
	<?php $next = get_permalink(get_adjacent_post(false,'',true)); 
		if($next != get_permalink()) { ?><a id="navi-right" href="<?php echo $next; ?>"></a><?php } ?>

Initial URL

                                

Initial Description
This snippet shows you how to get previous and next post in category URL.

Initial Title
URL's to next and previous posts in category

Initial Tags
url, wordpress, navigation

Initial Language
PHP