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.

Author: Caspar

The former account of

15 thoughts on “WordPress Posts, Pages and pagination”

  1. 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 🙂

  2. 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 😛

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

  4. 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?

  5. Pingback: Nga

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.