Languages: English • Bahasa Indonesia • 日本語 (Add your language)
Displays page-links for paginated posts (i.e. includes the <!--nextpage-->
Quicktag one or more times). This works in much the same way as link_pages() (deprecated), the difference being that arguments are given in query string format. This tag must be within The_Loop.
<?php wp_link_pages( $args ); ?>
<?php $defaults = array( 'before' => '<p>' . __( 'Pages:', 'twentyfourteen' ), 'after' => '</p>', 'link_before' => '', 'link_after' => '', 'next_or_number' => 'number', 'separator' => ' ', 'nextpagelink' => __( 'Next page', 'twentyfourteen'), 'previouspagelink' => __( 'Previous page', 'twentyfourteen' ), 'pagelink' => '%', 'echo' => 1 ); wp_link_pages( $defaults ); ?>
Displays page-links by default with paragraph tags before and after, using Next page and Previous page, listing them with page numbers as Page 1, Page 2 and so on.
<?php wp_link_pages(); ?>
Displays page-links wrapped in paragraph tags.
<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=page %'); ?>
Displays page-links in DIV for CSS reference as <div id="page-links">.
<?php wp_link_pages('before=<div id="page-links">&after=</div>'); ?>
This code snippet can be added directly to your content.php or single.php file in the position you want your pagination to display.
<?php wp_link_pages( array( 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>', 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>', ) ); ?>
Since: 0.71
wp_link_pages() is located in wp-includes/post-template.php
.