Function Reference/link pages
Languages:
English •
日本語 •
(Add your language)
This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists. See also wp-includes/deprecated.php.
Description
Displays page-links for paginated posts (i.e. includes the <!--nextpage--> Quicktag one or more times). This tag must be within The_Loop.
Replace With
Usage
<?php link_pages( $before, $after, $next_or_number, $nextpagelink, $previouspagelink, $pagelink, $more_file ); ?>
Parameters
- before
- (string) Text to put before all the links. Defaults to '<br />'.
- after
- (string) Text to put after all the links. Defaults to '<br />'.
- next_or_number
- (string) Indicates whether page numbers should be used. Valid values are:
- 'number' (Default)
- 'next' (Valid in WordPress 1.5 or after)
- nextpagelink
- (string) Text for link to next page. Defaults to 'next page'. (Valid in WordPress 1.5 or after)
- previouspagelink
- (string) Text for link to previous page. Defaults to 'previous page'. (Valid in WordPress 1.5 or after)
- pagelink
- (string) Format string for page numbers. '%' in the string will be replaced with the number, so 'Page %' would generate "Page 1", "Page 2", etc. Defaults to '%'.
- more_file
- (string) Page the links should point to. Defaults to the current page.
Examples
Default Usage
Displays page-links by default with line breaks before and after, using next page and previous page, listing them with page numbers as Page 1, Page 2 and so on.
<?php link_pages(); ?>
Page-links in Paragraph Tags
Displays page-links wrapped in paragraph tags.
<?php link_pages('<p>', '</p>', 'number', '', '', 'page %'); ?>
Change Log
Related
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()