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 = ''); ?>
array( 1, 5)or
'1,5'. This argument used to accept a list of IDs separated by 'and's, this was deprecated in 3.3.
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. Array or comma-separated list of category ID(s) from which the previous post should not be listed. For example array( 1, 5) or '1,5'.
<?php previous_post_link('%link', 'Previous in category', TRUE, '13'); ?>
previous_post_link() is located in