How to mod your theme to make use of <!–nextpage–>.
To tell WordPress to make use of this code, you need to insert some additional code into “the loop” in two different places, usually in your theme’s page.php and single.php pages. Here’s the code: (please note that the quotes are not being rendered properly, DO NOT copy and paste this code, write it manually in your page.php file.)
<?php wp_link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
I’m using the Structure theme by Justin Tadlock, here is a screen shot of where I’ve inserted the above code into the page.php file. I always put it right after the content.
After adding this, I can now use the <!–nextpage–> Quicktag when writing a page to split it into multiple pages. Notice I said page and not post? If you want to break the “page” while writing a post, you will want to insert this into your single.php file as well.
In future posts, I’ll be adding more extensive examples of this features and how to display your pages list differently.
Has this been helpful to you? What’s you’re favorite little-known WordPress mod?
If you see fit, please share this post on StumbleUpon or your preferred social site.









14 Comments
Great tutorial, thanks!
Interesting. I am a real wordpress newbie but I am trying to learn.
Dear Sir,
thank you very much for this great article! I have definitely problem with extra long articles and I will try to use your advice to corect the problems.
keep on good work and Happy New Year
Srecko Bradics last blog post..Last action hero
okaingyficpfnczgwell, hi admin adn people nice forum indeed. how’s life? hope it’s introduce branch
Thanks you Sir, you really save my times, because my new theme in my other blog doesn’t support quicktag, I love this new theme, yet most of my blog posts are very lengthy by which I have to split them all into several pages, and your tutorial really helpful and solved my problem, thanks again
Software For Downloads last blog post..Download i-FunBox iPhone File Browser
Sounds great… your article is still loading however…. Your site is very very slow. Over 30 seconds to open the second page. Maybe time for a new host…. or push those videos to youtube!!!
Ah the page has finished loading now. OK I’m off to mod the template!!!
Hey Mark,
I have been digging to see the cause of this…thanks for sticking with WPM:)
A million thanks. I was searching the Wordpress Plugin library for a pagination module. I found one but didn’t work. So, I searched for spiting posts on Google. I found this wonderful article. No wonder I found only one plugin for something like this. There’s no need for a plugin. Just type in that nice little tag. Perfect!
Thanks a lot for the guide. I found it very helpful. It’s useful to break up long articles to help improve the readability on one’s site, I think. Thanks again.
.-= Prostate Cancer Conquerer´s last blog ..Prostate Cancer Diagnosis and Symptoms =-.
Soundz Gud … does it mean that wordpress creates a new page for the continued content or is it still on the same page and it rather acts like a quick scroll? I’m a bit confused (as newbies often are!!)
.-= kansakare´s last blog ..BRCA1 or BRCA2 Genes, Aggressive cancer Of The Prostate, And Treatment =-.
While writing a tutorial, discovered I couldn’t break up the page. While researching the issue, decided I’d write another tutorial to document my findings. Happy to have found your customizing site. Your same article then solved my next issue before I even knew I had it! (The theme I was using didn’t support pagination.) Gave a shoutout in the tutorial to you. Many thanks.
.-= LocalBusinessCoach´s last blog ..Autoresponse Not Optional For Local Business =-.
I’m no WP guru, so maybe you can help me out with this. I put the necessary code into the theme files. But in one page when I split it with it works correctly making two pages, but it doesn’t keep the font and formatting on the second page. (ie:blockquote) In another example it splits the first page but when you click to the second page it is not the second half of the text but the entire text (one page) as if it were never split. And also doesn’t have any link back to the first page. Any ideas?
Thank you very much for this nice tutorial. Helped me enable pagination on my blog.
And how can I change the Meta Title to include %%page%% when using to split a post into multiple pages?
Ex: How to Split a Post or Page into Many, Page 2
One Trackback
[...] to Adam Warner of WordPress Modder for writing a definitive article, How to Split a Post or Page Into Many. Accessed October 25, 2009. [go [...]