Codex tools: Log in
Languages: English • 日本語 • (Add your language)
wp-includes/deprecated.php.Contents |
Used on single post/permalink pages, this tag lists the next post in chronological order from the current post. It can work in conjuntion with the previous_post() tag. This tag must be used in The Loop.
For the index, category, and archives templates, use the posts_nav_link() tag.
<?php next_post('format', 'next', 'title', 'in_same_cat',
limitnext, excluded_category); ?>
By default, displays text "next post:" as link along with post title.
<?php next_post(); ?>
Displays specified text as link, without including the post title. If excessively long post titles break your layout, you may want to use this. "Next »" is the specified text in this example; you can put whatever you want.
<?php next_post('%','Next »', 'no'); ?>
Displays previous and next post links in the format with the text before the post title not shown as a link.
<p><?php previous_post('%', 'Previous:', 'no'); ?>
| <?php next_post('%', 'Next:', 'no'); ?></p>
To display text, like arrows («), at the beginning of the previous post link and at the end of the next post link so it looks like:
<?php previous_post('« « %', '', 'yes'); ?>
| <?php next_post('% » » ', '', 'yes'); ?>
See also previous_post().
body_class(), next_image_link(), next_post_link(), next_posts_link(), post_class(), post_password_required(), posts_nav_link(), previous_image_link(), previous_post_link(), previous_posts_link(), single_post_title, sticky_class(), the_category(), the_category_rss(), the_content(), the_content_rss(), the_excerpt(), the_excerpt_rss(), the_ID(), the_meta(), the_shortlink(), the_tags(), the_title(), the_title_attribute(), the_title_rss(), wp_link_pages()