How-To Paginate WordPress Posts and Pages into multiple pages
Splitting the long WordPress posts or pages is the best way to display your long and different contents on multiple pages without changing the Post or Page’s URL. If you paginate WordPress long post or page, it will be easy for readers to jump from different parts of the post. As well such way you can make your post more interesting for blog readers.
You must have seen such features on different websites and you may have been thinking which WordPress Plugin used to present the post in this way. But WordPress have Built in feature for Post or Page pagination. All you have to add the following tag in your post where you want to break the page or Post. Go the HTML editor and add the following code :
That’s all, by putting one simple <!–nextpage–> tag in the content of your post or page, you are breaking the post to get more views for a single post or page.
Styling the pagination View
Most of the WordPress themes use single.php file to display the Post content, in that file need to tell WordPress to show the pagin links for <!–nextpage–> quicktag. If you don’t want to display the default nextpage quicktags then you have to create the CSS class for styling and need to edit the php loop on single.php file or need to add a function in the function.php file.
If you are using DIYTheme, then read this tutorial for detail about Customizing and Styling the NextPage “Post Pagination” for your theme. Otherwise add in single.php (or loop-single.php) you’ll find the WordPress loop which displays your post or page.
<div id="content" role="main"> <?php while ( have_posts() ) : the_post(); ?> <nav id="nav-single"> <h3 class="assistive-text"><?php _e( 'Post navigation', 'twentyeleven' ); ?></h3> . . </nav><!-- #nav-single --> <?php get_template_part( 'content', 'single' ); ?> wp_link_pages(); <?php comments_template( '', true ); ?> <?php endwhile; // end of the loop. ?> </div><!-- #content -->
When you add the wp_link_pages function in the loop, this loop will show the post or page title and the content, and displays pagination in the single post or page.
Twenty eleven WordPress theme by default have the pagination style as follow:
<span class="nav-previous"> <?php previous_post_link( '%link', __ ( '<span class="meta-nav">←</span> Previous', 'twentyeleven' ) ); ?> </span> <span class="nav-next"> <?php next_post_link( '%link', __ ( 'Next <span class="meta-nav">→</span>', 'twentyeleven' ) ); ?> </span>
In the above loop displaying the some default arguments as used by the Twenty-Ten WordPress theme. If you find any difficulty in style the pagination then contact us, we can help you to match your pagination according to your theme. If you find this post is helpful for you, like the WPArena facebook’s fan page.