How to Add Page-Link Tag (Multiple Page Post / nextpage) Support to WordPress

If you have been trying to figure out how to add support for multi-page posts in WordPress that have pagination buttons at the end of each page that look like this:

then look no further than this post!

The screenshot you see above is actually the exact pagination style we use for long posts that we break into multiple pages on this site and we got the code after 3 hours of searching from Matthias Pospiech’s blog.

NOTE: We are not using the very popular WP-PageNavi plugin in this tutorial, because that adds support for paging posts on the front page of your site, not paging long, individual posts that have been broken up using the WordPress’s nextpage support. We also found no intuitive way to modify the WP-PageNavi plugin to do what we wanted, and Lester Chan has stopped working on his excellent collection of WP plugins unfortunately.

Matthias actually documented a much more complicated process than we needed, so we extracted the useful bits that we utilized to add pagination support, and are presenting it here for anyone else finding this page via Google, pulling their hair out trying to figure this out like we were.

Also, we are sorry for the odd mish-mash title of keywords; this problem is referred to in so many different ways: “multi-page posts“, “how to split long posts into multiple pages“, “Why doesn’t nextpage work?!“, “Page-Link support?” and so on and so on. We wanted to choose a title that people could identify easily.

Alright, let’s get started!

Break Long Posts into Multiple Pages

As it turns out, WordPress already supports this functionality (for a while now) via the “Page-Link tag“:

<!-- nextpage -->

Using that marker anywhere in your story (you have to type it in from the HTML editing mode) WordPress will know to stop rendering the story at that point and divide the following contents into individual pages – accessed by appending a “/{PAGE_NUMBER}/” argument to the URL when clicked, like “…/my-story/” becomes “…/my-story/2/“.

We strongly recommend installing the NextPage Buttons WordPress plugin from Shawn Parker to make your life easier in this regard. It will add a button into the toolbar for inserting a <!– nextpage –> element:

Unfortunately, not a lot of WordPress themes actually support noticing this and rendering a pager at the bottom of posts; even the lauded WooThemes seem to be missing this support. At least from Canvas.

UPDATE #1: In true Woo-fashion, they have added support for Pagination. This is why I love buying their themes.

NOTE: The pagination support you will find for WooThemes via their support forums is paging stories on the front page of the site, not actual pagination support for longer stories broken up with the <!– nextpage –> snippet.

And if you do have a theme that notices it, out of the box the pagination renders like this:

Because of this omission it is up to us to add this support manually. Good thing we are brave, right!?

Pagination Support – The CSS

There are 2 parts to adding the pager at the end of long stories:

  1. The CSS to style the list of pages so it looks nice. I happen to like the simple “box” view we use.
  2. Modification to the single.php file to actually insert the page list at the end.

Let’s start with the CSS first, because it’s the easiest.

As mentioned above we are not using WP-PageNavi (that plugin does something else), so when we went to Matthias’s page, we snagged all the CSS style classes prefixed with the name “.pagenumbers“; the list of styles ends up looking like this:

.pagenumbers{
	margin-bottom: 10px;
}
 
.pagenumbers a, .pagenumbers a:link {
	padding: 4px 6px 4px 6px;
	margin: 2px;
	text-decoration: none;
	border: 1px solid #e7e7e7;
	color: #1d8dcb;
	background-color: #FFFFFF;
}
.pagenumbers a:visited {
	padding: 4px 6px 4px 6px;
	margin: 2px;
	text-decoration: none;
	border: 1px solid #e7e7e7;
	color: #1d8dcb;
	background-color: #FFFFFF;
}
.pagenumbers a:hover {
	border: 1px solid #3b3b3b;
	color: #3b3b3b;
	background-color: #FFFFFF;
}
.pagenumbers a:active {
	padding: 4px 6px 4px 6px;
	margin: 2px;
	text-decoration: none;
	border: 1px solid #e7e7e7;
	color: #e56100;
	background-color: #FFFFFF;
}

You can take those and copy them right into your styles.css near the bottom or if you have a custom.css, that is better yet (to avoid loosing the changes if you update your theme).

You can of course modify those styles to suite your needs, but out of the box it will make the pagination buttons at the end of the story look like the screenshot at the top of this tutorial.

Pagination Support – The PHP Code

Now that we have successfully added the styling we needed to not make the styles look too plain, we need to modify our theme to tell WordPress to crap out the list of pages for a story that is broken up into multiple pages.

What you will want to do now is edit the template used to render individual posts, that happens to be single.php, displayed as “Single Post” in the admin interface:

I’ve blurred out all the extraneous, theme-specific code to make it easier to find the important parts. We’ll take this step-by-step:

  1. Find the <div class=”entry”> block, this is the <DIV> that contains the post body.
  2. Find the <?php the_content(); ?> code snippet, this is where the actual text from your post is inserted into your template from the database.

Directly under the line you found for #2 above, we are going to put the following snippet of markup + PHP script:

<div class=”pagenumbers”>
<?php wp_link_pages(array(‘before’ => ‘<p>Pages:’,'after’ => ‘</p>’, ‘next_or_number’ => ‘number’));  ?>
</div>

The WordPress API call wp_link_pages tells WordPress to render a block of HTML linking to the additional pages of a post. The additional complicated looking stuff are just the prefix (1st arge) and suffix (2nd arg) content you want the function to output to the page (in our case, some paragraph markers) and then lastly, how you want the page links to look (numbered pages or “Next” text to click).

Now save your changes to your template.

REMINDER: If you use a caching plugin like WP Super Cache or W3 Total Cache, make sure to clear the caches completely so you aren’t accidentally looking at old page HTML.

Conclusion

Now that you’ve made your changes to your template, go edit a post and add the <!– nextpage –> marker (remember, via the HTML view, or using the button in the toolbar only), save the post then view it and you should see a list of pages at the bottom of the post.

Big thanks to Matthias Pospiech for being smarter than us and figuring this out.

Happy WordPressing!

Update #1: Big thanks to Chris pointing out that the code snippet above was missing a ‘class’ argument for the DIV (as shown in the screenshot).

Tags: , , , , , , , , , , ,

About Riyad Kalla

Software development, video games, writing, reading and anything shiny. I ultimately just want to provide a resource that helps people and if I can't do that, then at least make them laugh.

, , , , , , , , , , ,

76 Responses to “How to Add Page-Link Tag (Multiple Page Post / nextpage) Support to WordPress”

  1. Nouman August 26, 2010 at 9:56 am #

    Not working with my theme canvas | woo theme.

    :(

    • Riyad Kalla August 26, 2010 at 12:36 pm #

      Nouman,

      This site runs Canvas, I wrote this tutorial based on my modifications I made *to* Canvas… so I’m pretty hopeful we can get you up and running.

      Give me a link to your site, an an example story you are modifying. We’ll take a look at it together.

      • Nouman August 26, 2010 at 12:42 pm #

        I tried it on my site (goshycab.com) but it shows blank page when i open a post.
        I am using simple code now, that works fine, but this codex isn’t working for me. Don’t know why.

        • Riyad Kalla August 26, 2010 at 12:53 pm #

          Nouman, there are two edits to make:

          1. The new CSS
          2. Inserting the that contains the call to the “wp_link_pages” function.

          What edits did you make and where did you end up sticking the “wp_link_pages” div?

          When the page doesn’t render, that means you have an error in your PHP — if you check your apache error log, there is likely some error in there.

          Also that can happen if you tried to stick wp_link_pages outside “the loop”.

          • Nouman August 26, 2010 at 12:58 pm #

            I added up the the CSS code in custom CSS file, and added the other code* in single.php file simply.

            *other code means the one quoted above.

  2. Riyad Kalla August 26, 2010 at 1:10 pm #

    Nouman, yes… I figured that much out, what line exactly did you add the code snippet on in the single.php file?

    • Nouman August 26, 2010 at 1:12 pm #

      I added this code below:

      ‘Pages:’,’after’ => ‘’, ‘next_or_number’ => ‘number’)); ?>

      ‘Pages:’,’after’ => ‘’, ‘next_or_number’ => ‘number’)); ?>

      • Nouman August 26, 2010 at 1:16 pm #

        This is the screen shot of code i added to single.php

        http://goo.gl/xi5y

        i added it as it is.

      • Riyad Kalla August 26, 2010 at 1:18 pm #

        You aren’t answering my questions.

        • Nouman August 26, 2010 at 1:23 pm #

          I added the code (link above) after “the_content” in single.php file.

          • Riyad Kalla August 26, 2010 at 1:55 pm #

            That is the correct place to add it, not sure why it didn’t work. You would have to add the code back, then check the Apache error log to see what error is occurring.

            • Riyad Kalla August 30, 2010 at 4:24 am #

              Nouman,

              I just got an email from Magnus (from WooThemes), they have officially added paging support to the Canvas theme. So if you update, you should have it without having to go through this tutorial.

              • Nouman August 30, 2010 at 6:27 am #

                Sounds interesting :)

                But, I have changed the theme now. had been using wootheme since year.

  3. julieH August 28, 2010 at 7:21 pm #

    I had some problems pasting your php code in my template when I copied and pasted, until I realized that I had a single curly quote instead of a straight quote mark in the php code. Once I switched the quote marks everything works great. Nice tutorial, thanks! :-)

    • Riyad Kalla August 30, 2010 at 4:24 am #

      Julie,

      It didn’t even dawn on me that the quotes would copy-paste incorrectly, doh!

      I went ahead and re-editing the code snippet so it copy-pastes correctly as single quotes and not as alternating open/close quotes that WordPress desperately wants to change them into.

      Thanks for the heads up.

  4. maria September 12, 2010 at 11:28 am #

    way too complicated. ill stick to the

    • Riyad Kalla September 12, 2010 at 9:28 pm #

      Maria,

      If your theme doesn’t support <!– nextpage –> then using that markup does nothing except truncate your post at the first page with no way for anyone to read the rest of it.

      That was the point of this entire post… how to add support for that if your theme doesn’t have it.

  5. maria September 12, 2010 at 11:29 am #

    way too complicated ill stick to the [!-nextpage - ]

  6. Jurruro September 16, 2010 at 5:32 am #

    Hey Riyad, i would really appreciate if you could give me a hand with this.
    My theme didn’t support the pagination but i added it and it works about 50%.

    At the bottom of the article i see the numbers (1,2,3 etc.) but when i click for example page number 2 it doesn’t go to it, looks like it just refreshes the first page.

    i added the code in single.php like this :

    ———————————————————————-

    <?php the_content(__('Continue Reading’,woothemes)); ?>
    ‘Pages:’,'after’ => ”, ‘next_or_number’ => ‘number’)); ?>

    ——————————————————————-

    I don’t know where to ask for help anymore. Maybe i need to add other code snippets in some other pages.
    Could you try a global search in your theme, or something?

    Thank you.

    • Riyad Kalla September 16, 2010 at 5:50 am #

      Jurruro,

      That’s the wrong snippet of code — I’m not actually sure where you got that snippet from, I don’t use that in the article above.

      Did you give the article a try?

      CLARIFICATION: By “wrong” I just mean I don’t know what the snippet of code you provided does, in the article I use the wp_link_pages function to get the paginated values, I don’t think the_content function that you are using does anything with pagination, I have no idea why it works at all to be honest.

  7. Jurruro September 16, 2010 at 6:04 am #

    the comment section changed the code. Yes, i actually did it like in your article, but i think there is more to it, in another .php or something.

    =

    ” B. # Find the ?php the(_content(); ? code snippet, this is where the actual text from your post is inserted into your template from the database.”

    ‘Pages:’,’after’ => ”, ‘next_or_number’ => ‘number’)); ?> = ?php wp_link_pages(array(‘before’ => ‘Pages:’,’after’ => ‘’, ‘next_or_number’ => ‘number’)); ?

    Anyways, thanks for a fast reply.

    • Riyad Kalla September 16, 2010 at 6:10 am #

      Oh, hmmm (it is scrubbing HTML for safety reasons, makes it hard to post code directly as-is). If you want to post your single.php file for me somewhere I can take a look — you can use http://pastebin.org/ to post the code then give me a link to look at.

      Also be sure to include an example page where it works, and an example page where it doesn’t (links to your site) so I can take a look and see what’s up.

      QQ: On the pages where it doesn’t work (you said it works 1/2 the time) does the WHOLE post show, or is it truncated right at where you put the nextpage marker correctly?

      You mentioned when you click the pages (like 2 or 3) it just seems to refresh the current page, but does the URL to the story in your address bar change and append the /2 or /3 to the URL?

      If NOT, can you try and do that manually and see if you see the 2nd and 3rd pages of the story? Just add “/2″ to the end of the URL, so it looks like:
      “http://mysite.com/….someurl…/my-story/2″

  8. Jurruro September 16, 2010 at 6:27 am #

    Ok, the page is still under construction and i just removed the ip restriction for a bit.
    The code is here : http://pastebin.org/883726

    http://tiny.cc/lkgx4 <- doesn't work (pagination just after the related articles thumbnails)

    http://tiny.cc/pti16 – Here i previewed the default theme and it DOES work
    (my theme activated, default one previewed)

    So somehow it should be theme related.

    I tried to add in the adress bar /2 and it's the same. Have a look for yourself.

    • Riyad Kalla September 16, 2010 at 6:37 am #

      Jurruro,

      Can you paste-bin the raw HTML content for that post for me (I am done with single.php, you can expire it if you want)?

      Just flip to the “HTML” tab in the editor view and copy paste that content into a pastebin so I can see what it is suppose to look like?

  9. Jurruro September 16, 2010 at 6:57 am #

    I made a new post just with some text in it and it works.

    someone from the writers team broke the code, they like to mess up with divs and stuff even if they don’t know anythink about it.

    I’d like to say Big thanks, i went to sleep yesterday at 4 am because of this and finally, today i got the help i needed.Great!

    PS. What do you think of the blog’s design? :)

    • Riyad Kalla September 16, 2010 at 7:37 am #

      Ah! I’m glad to hear that it’s working now. Overzealous writers can be a blessing and a curse :)

      The site looks great, from the single.php code it looks like you are using a WooTheme, but the site looks so customized I don’t recognize it as any of the WooThemes, you’ve done a great job customizing!

  10. Luca B. October 28, 2010 at 3:11 pm #

    Hi, i’m just trying to know if is possible to get 2-3-…-n pages by any page/post ID after this split.
    For exsample: If I need it on another page, as excerpt…
    Thank you very much,

    • Luca B. October 28, 2010 at 3:12 pm #

      Excuse me i’d make a mistake on e-mail address… now it’s correct,
      Bye

    • Riyad Kalla October 29, 2010 at 8:30 am #

      Luca, yes once multipage is enabled, you can reefer to specific pages of the linked story by using the /pagenumber method like: …/tutorial/2 – for page 2 of your tutorial story or something.

      Let me know if i misunderstood your question and you were asking something else.

  11. Lucho December 4, 2010 at 5:01 am #

    Great tutorial. The curly quotes issue delayed me a bit (thnx, JulieH) and dumbly enough I forgot to style my DIV. Once I named it This worked like a charm

    • Riyad Kalla December 4, 2010 at 10:57 am #

      Lucho, glad to hear things are working smoothly.

      • Lucho December 5, 2010 at 4:10 am #

        I have, however, a problem: when I want to print, I am able to print only one page at a time.

  12. Adam December 18, 2010 at 2:20 am #

    Hi Riyad

    Great post, thank you

    I can get my post page to display the pages using wp_link_pages() and I have put the css code in to my style.css file at the bottom like the tut says

    However when i put the next page code in to my post and preview it the pages aren’t showing up like they should be

    Instead they show up very small and under my social tweetme me button and related posts

    Any ideas?

    Cheers!

    • Riyad Kalla December 21, 2010 at 10:20 am #

      Adam, it’s hard to say without an example to look at. Can you share a link where this is happening?

  13. Chris January 8, 2011 at 2:20 am #

    The problem with this tutorial is it entire forgot to add the “pagenumbers” tag referencing the CSS code added. What you paste into the single.php file should be this:

    ‘Pages:’,'after’ => ”, ‘next_or_number’ => ‘number’)); ?>

    • Chris January 8, 2011 at 2:21 am #

      Well, the comment didn’t show all the text I posted. You have to add this:

      <

      before the rest.

      • Chris January 8, 2011 at 2:22 am #

        OK this site isn’t displaying code pasted into comments. Looks like you’re on your own, like I was.

    • Riyad Kalla January 9, 2011 at 12:07 am #

      Chris, thanks for catching that. I had to read and re-read that code snippet section 3 times before I saw the omission (it is in the screenshot, but not in the snippet) and my brain kept “seeing it” even though it wasn’t there.

      Post updated with credits given, thanks.

      • Chris January 9, 2011 at 7:23 am #

        Yep, that’s it. I have to say, I scoured the internet for hours looking for a solution like this and it was exactly what I was looking for. Thanks for posting the tut.

        One thing that is still unclear to me though, and maybe to others, is exactly how to use the $args ‘nextpagelink’ and ‘previouspagelink’ functions for other options instead of just numbers. I’ve looked all over, but haven’t been able to find a written code example that follows the wp_link_pages part.

        http://codex.wordpress.org/Template_Tags/wp_link_pages
        http://codex.wordpress.org/Styling_Page-Links

  14. Stuart January 26, 2011 at 6:30 pm #

    The thing that is vexing me is that I use Thesis and installed the plugin “Easy Multiple Pages” to add a button so that I can add in the part.

    It works fine in the send that I have:

    Page 1 – Page 2 – Page 3 etc

    And that they are all linked.

    However, I notice two problems:

    1/ that Google NEVER indexes any pages apart from the first one.

    http://www.mysite.com/thepage/2

    etc. Never gets indexed.

    Some of the pages I have cover 7 pages. So this is a real problem, as the search engine is counting only 400 words of a 3000 word article.

    2/ The extra pages 2 – 7 don’t show in the sitemap, or the xml sitemap, or the rss feed.

    Do you know of any way of ‘fixing’ these problems?

    • Riyad Kalla January 28, 2011 at 8:50 am #

      Stuart that is pretty major… does that Thesis plugin use Ajax to implement the pager control or is it actually insertin a-href elements in your page at the bottom of articles?

      If it’s a-href them search engines SHOULD be indexing those pages.

      If your site is a relatively low-traffic site, what might be happening is that Google (and whoever else) is only indexing what they find in the sitemap to save harvesting time and until the site gets more popular the crawler doesn’t spend more time on the site… I’m not sure, that is just a guess. You could try the Google Webmaster Tools to see if the harvester information gives you any indicators as to why those sub pages aren’t getting indexed.

  15. Stuart January 26, 2011 at 6:36 pm #

    P.S The same is true on your blog.

    If you look at the long post you split up:

    http://www.thebuzzmedia.com/all-nite-scream-o-rama-postmortem/

    And look at the Google cache it is right.

    If you however say you look at page 3

    ie http://www.thebuzzmedia.com/all-nite-scream-o-rama-postmortem/3/

    And look at the Google Cache it is actually showing page 1. (on mine it doesn’t even do that, but clearly you would really want each page being cached)

    • Riyad Kalla January 28, 2011 at 8:52 am #

      Huh… never even thought to check that, good find. In my case we only have a handful of REALLY long articles so it’s not too big of an issue, but if we were to regularly start breaking up articles that is really important to know that.

      Using my own advice and checking the Webmaster Tools I don’t see any harvest errors with those subpages so I’m not sure whats up.

  16. Jordan February 15, 2011 at 10:21 am #

    If my theme has no single.php file, can I just create one and paste in the code provided? Amateur speaking, needless to say.

    • Riyad Kalla February 15, 2011 at 11:01 am #

      Jordan,

      That is odd that your theme is missing that… under Settings > Reading, what are the two drop down boxes set to? What ever is set in the Single Post box, that is the theme file you will need to edit to add paging.

      • Jordan February 16, 2011 at 3:47 pm #

        Riyad?

        • Riyad Kalla February 16, 2011 at 5:29 pm #

          Jordan, sorry for the delay, got up to my eyes in another project and went dark. I just replied.

  17. Jordan February 15, 2011 at 11:36 am #

    Hi Riyad. Thanks for the speedy reply. I’m not sure what you’re referring to — the two drop downs are not set to anything, but I’m not sure how it would help if they were. Here is a screen shot of the Reading settings page: https://picasaweb.google.com/BeachedMiami/Random?feat=directlink

    • Riyad Kalla February 16, 2011 at 5:24 pm #

      Jordan,

      Hrrm, well regardless, to answer your original question I believe anywhere in the “the loop” should suffice for the code to work.

      • jordan February 16, 2011 at 6:51 pm #

        I stuck it in the page.php file. no dice. I don’t php at all though, so I may be missing a crucial step.

        • Riyad Kalla February 16, 2011 at 7:22 pm #

          We have to find the template that is being used to render the actual pages that you are trying to edit the style to… it is always “single.php” unless that has been changed somewhere in your setup, and you mentioned that single.php doesn’t exist… so it’s hard for me to figure out where it went.

          page.php is used to render simple pages (without the story/comment structure) like the About page or Advertise page on this site… when you go to Appearance > Editor, down the right hand side, what is the actual PHP file listed for the “Single Post” category? That is the one you will want to edit.

  18. Stephanee March 7, 2011 at 4:17 pm #

    Thank you for the great blog here on how to do this. I’ve been trying to figure out the best way to handle long posts. While I would like to use the page number approach, my concern is the bad rap this is getting for Google SEO. I’ve read that each page title is duplicated, as are the links to that page, so the Google Bots don’t like it. Is there a workaround for this? Is it true that this would harm page ranking? We don’t want to be penalized just because we’re trying to break up lengthy posts. The alternatives appear to be using tabs (the drawback being that tabs appear at the top and not the bottom of a post, so the reader has to scroll back up for the next section) or actually creating a new post for every page of the article and then using hyperlinks to navigate the post pages. Do you have any ideas or comments on this?

    Thank you!

    • Riyad Kalla March 10, 2011 at 8:19 am #

      Stephanee, I’m sorry I can’t help on the SEO front.

  19. sam March 11, 2011 at 4:51 am #

    I have done this and pagination show up well on my page but when I click them, they keep landing on the same page. For example, “www.site.com/articles/” and “www.site.com/articles/2″ are exactly the same.

    Can you please help me out?

  20. Kevin April 3, 2011 at 11:38 am #

    Hi Riyad,

    Thanks for this little guide.

    I am using the theme Skeptical by Woo themes and after editing the two css style sheets and single.php, I’m running into the issue where instead of my article being broken up into a few pages, it is showing my article as one long post.

    Was there anything else that I was suppose to edit?

    Any help would be greatly appreciated.

    Regards,
    Kevin

    • Kevin April 3, 2011 at 2:01 pm #

      Actually, I figured out what I did wrong.

      This guide was awesome!

      • Riyad Kalla April 12, 2011 at 5:07 am #

        Kevin, can you share what was going wrong incase anyone else runs into the same issue?

  21. Den April 16, 2011 at 8:26 am #

    Worked great…thanks

  22. Gina June 8, 2011 at 3:49 pm #

    Riyad,

    Great tutorial and thanks for helping all of us out:-) I’m using Canvas by Woo themes too and wonder if you may be able to put something in writing up which deals with how to use pagination for posts with long comments using Canvas. That also has the numbered boxes like you discuss in this tutorial. Would appreciate any help or advice on how to handle that issue.

    Thanks again…great job!

    • Riyad Kalla June 8, 2011 at 8:31 pm #

      Gina, I *think* Canvas added paging after it’s release, I sent them an email about this post and I believe they integrated it directly into the theme. Are you not seeing the right behavior for multi-paged posts?

      As for a tutorial specific to Canvas, I actually wrote this tutorial while I was modifying an earlier version of Canvas, so all the tags I mention as far as placement goes you should find right away in your canvas files.

  23. Das Chan June 18, 2011 at 11:49 pm #

    Hi Riyad, I’m running WP 3.1.2 Multisite-enabled Twentyten child theme on a local dev setup operating with MAMP 1.9.4 (PHP 5.3.2), and your solution is working very nicely.

    However, can you help with a bit of code to help reduce the number of pages displayed? I have a single post, an article running 60 pages, and there are four rows of page link tabs stretching across the bottom! This is true on the blog home page as well. I’ve seen it in action on many websites. I’d like to shorten it, you know, like the left arrow for previous, right arrow for next, a few page numbers showing up, and ellipsis for the remainder.

    I’m sure I’m not the only one who is lookiing for this. I’m not sufficiently acquainted with PHP to work it out, so I’m hoping you have the answer!

    • Riyad Kalla June 20, 2011 at 12:13 am #

      Das, that is too open ended of a question unfortunately. I am not familiar enough with that theme directly to have some copy-paste code snippets for you. Check with the author of the theme though, this can’t be the first time someone has asked, he might have a snippet for you ready to go.

  24. krzh July 24, 2011 at 6:25 am #

    Hey there,

    I tried to add this functionality to my theme, but I encounter a problem, when trying to put it into my single.php file. I can’t find the . When I simply try to put the code as you can see in the linked image, it gives me an error:
    Parse error: syntax error, unexpected (…) in line 15
    here’s a link to a print screen of my admin page:
    http://imageshack.us/photo/my-images/854/screenya.png/
    I’m really new to the wordpress thing, so probably I’m missing something.

    • krzh July 24, 2011 at 6:27 am #

      I meant I couldn’t find the div class “entry”

  25. Andrew September 20, 2011 at 2:56 pm #

    Great, thanks this worked for me and a life saver, at first i had a php error after coping and pasting the code in the single.php file.
    I had to rewrite the single and double quotes(i.e. copying and pasting retained some of the fonts of the code copied) in the code in order for it to work.

  26. AJCiti October 17, 2011 at 9:20 pm #

    OMG! This was the same problem I had! I changed them to straight quotation marks and it worked! SUCCESS! I’m so happy you have no idea!

    Thank you for this amazing tutorial, I couldn’t have done it without this and for those who commented as well ^_^. Also, I did this modification in the bueno theme and it worked :-)

  27. bergauf October 30, 2011 at 5:22 am #

    Great job! Thanks!

  28. Syamsul Alam January 13, 2012 at 8:14 pm #

    Hey, it will be really great if you can create another tutorial about this for Thesis theme. I have a hard time doing this for Thesis theme. Hopefully you can help me.

    • Riyad Kalla February 2, 2012 at 1:50 pm #

      Syamsul, I have never worked with Thesis but I know it’s a really robust theme/platform… I imagine you have figured out how to do this by now (sorry I am replying late), would you mind coming back here and linking to the docs or tutorial you found that answered this question for you… or just how you got it to work?

      I feel like there has to be a hook in the Thesis platform specifically for this…

  29. dani s June 26, 2012 at 12:28 pm #

    Hi,
    great post! i have been looking for this for a very long time now…the problem is that the page 1 2 thing comes at the very bottom of the page and is quite further down than the actual post. i fear that my readers might miss the next page and think the article is incomplete. Please give me some solution to this new problem. thnx for solving my previous one!

  30. Rahul Kashyap July 4, 2012 at 4:11 am #

    thanks sharing this post but my page css not working plz tell me how can i run our css in my post page

  31. Lily May 1, 2014 at 7:12 pm #

    Hi! I did everything this tutorial said, but it’s not showing up for me.

    Does this work with regular (static) pages? Because that is what I’ve been looking for… a pagination for a series of regular pages that I want to link together.

    I don’t know what I’m doing wrong, but I would really appreciate any help!!

    Thanks so much!!! :)

Trackbacks/Pingbacks

  1. 55 things media organizations can do with WordPress as CMS | WP Journo: WordPress CMS & Journalism - September 16, 2010

    [...] Paginate lengthy content for usability, pageload, monetization and SEO reasons. With WordPress, you can make it easy for producers or editors to add designy items like pull quotes,  icons and other custom formatting to enrich your visual storytelling and page readability. [...]

  2. Nice wp-pagenavi css styling | Mognet - June 5, 2011

    [...] http://www.thebuzzmedia.com/how-to-add-page-link-tag-multiple-page-post-nextpage-support-to-wordpres… [...]

  3. Nice wp-pagenavi css styling | Mognet - August 12, 2012

    [...] Luke from WP Code Snippets has kindly pointed out a possible solution to add pagination stylings for multi-page posts over at this link here. [...]

  4. 55 things media organizations can do with WordPress as CMS / WP Journo: WordPress & Journalism - September 21, 2013

    [...] Paginate lengthy content for usability, pageload, monetization and SEO reasons. [...]

Leave a Reply


9 − 3 =