Version: 1.6.2 Template tags (for use in single.php) to create post navigation loop (previous to first post is last post; next/after last post is fir
The plugin provides two template tags for use in your single-post theme templates.
function next_or_loop_post_link( $format='%link »', $link='%title', $in_same_cat = false, $excluded_categories = '' )
Like WordPress's next_post_link(), this function displays a link to the next chronological post (among all published posts, those in the same category, or those not in certain categories). Unlink next_post_link(), when on the last post in the sequence this function will link back to the first post in the sequence, creating a circular loop.
function previous_or_loop_post_link( $format='« %link', $link='%title', $in_same_cat = false, $excluded_categories = '' )
Like WordPress's previous_post_link(), this function displays a link to the previous chronological post (among all published posts, those in the same category, or those not in certain categories). Unlink previous_post_link(), when on the first post in the sequence this function will link to the last post in the sequence, creating a circular loop.
$format
(optional) A percent-substitution string indicating the format of the entire output string. Use %link to represent the next/previous post being linked, or %title to represent the title of the next/previous post.
$link
(optional) A percent-substitution string indicating the format of the link itself that gets created for the next/previous post. Use %link to represent the next/previous post being linked, or %title to represent the title of the next/previous post.
$in_same_cat
(optional) A boolean value (either true or false) indicating if the next/previous post should be in the current post's same category.
$excluded_categories
(optional) A string of category IDs to which posts cannot belong. Due to goofy a WP convention, the category IDs need to be joined by " and ", i.e. "14 and 15 and 31".
<div class="navigation">
<div class="alignleft"><?php previous_or_loop_post_link(); ?></div>
<div class="alignright"><?php next_or_loop_post_link(); ?></div>
</div>
Requires: 2.6 or higher
Compatible up to: 3.3.2
Last Updated: 2011-7-15
Downloads: 3,469
Got something to say? Need help?