Codex tools: Log in
Used on single post permalink pages, this template tag displays a link to the previous post which exists in chronological order from the current post.
This tag must be used in The Loop.
<?php previous_post_link($format, $link, $in_same_cat = false, $excluded_categories = ''); ?>
Displays link with left angular quote («) followed by the post title of the previous post (chronological post date order).
<?php previous_post_link(); ?>
Displays link with previous chronological post's title wrapped in 'strong' tags (typically sets text to bold).
<?php previous_post_link('<strong>%link</strong>'); ?>
Displays custom text as link to the previous post within the same category as the current post. Post title is not included here. "Previous in category" is the custom text, which can be changed to fit your requirements.
<?php previous_post_link('%link', 'Previous in category', TRUE); ?>
Displays link to previous post in the same category, as long as it is not in category 13 (the category ID #). You can change the number to any category you wish to exclude. Exclude multiple categories by using " and " as a delimiter.
<?php previous_post_link('%link', 'Previous in category', TRUE, '13'); ?>
previous_post_link() is located in
Pagination: posts_nav_link(), next_posts_link(), previous_posts_link(), get_next_posts_link(), get_previous_posts_link(), paginate_links() wp_link_pages(), next_post_link(), previous_post_link(), next_image_link(), previous_image_link(),