WordPress Posts, Pages and pagination

Chewing on WordPress.

While rummaging through the WordPress theme code I stumbled upon this vague function call ‘link_pages()‘. Not knowing what is was or did, I looked it up in the documentation. And it seems that WordPress can paginate (lengthy) posts out-of-the-box. Great! But while the difference between a post and a page can be confusing for WordPress starters, adding pagination to the equation may be too much. :-)

That’s why it probably is somewhat hidden. (Or should I have read the manual?) Nonetheless, for people prone to write elaborate posts it could come in handy. All you need to do is add the following magic code in your post, <!--nextpage-->, and your off. Notice the pages links below.

15 thoughts on “WordPress Posts, Pages and pagination

  1. Pingback: quasi.dot » Blog Archive » Read the rest of this article…

  2. Pingback: Paginar un post en Wordpress » paranovatos.com

  3. Pingback: Search Engine Optimization for Wordpress Blogs

  4. de ce?

    sorry to re-open an year old post but next-page tag works even in the home page, all you have to do is to put in the index.php or home.php the code:

    <?php link_pages(); ?>

    PS: i was searching something about wordpress pagination and i found your post :)

  5. yMladenov

    Thanks a lot!
    I’m writing just the lengthy articles you mentioned. BTW, I landed on this page from the “wordpress pagination” phrase on Google. Good seo :P

  6. lee

    I have been scouring the web for this answer and all I got was pages of coding. Yours was sooo simple. Thank you!!!!!!!!!

  7. Pingback: Skint & Demoralised

  8. Lampdocs

    I’ve got a problem: sometimes my posts are splitted, but the pagination menu is not shown. I am using , and pages really exist, but “1 2 3 ” is not shown. What could be the problem?

  9. Pingback: Nga

Leave a Reply

Your email address will not be published. Required fields are marked *


one + 3 =

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>