ThinkLemon

I think there used to be a tagline about (tag)soup here… anyway…


Also visit:


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.

Go to article page: 1 2 3

Previous article: Next article:


15 Responses to “WordPress Posts, Pages and pagination”

  1. quasi.dot » Blog Archive » Read the rest of this article… Says:
    September 7th, 2006 at 11:12 pm

    [...] Ho scoperto quasi per caso che WordPress supporta “out of the box” la possibilità di paginare un post piuttosto lungo. Non che sia una necessita’ impellente (a meno di non voler provare a raddoppiare il numero di page view quasi per incanto…) ma e’ divertente. Il trucco consiste nell’inserire la parola magica <!–more–> nel punto in cui si vuole l’interruzione del testo. Se funziona lo si vede qua. Il suggerimento mi e’ arrivato via Think Lemon, anche se con riferimento al quicktag <!–nextpage–>. [...]

  2. Paginar un post en Wordpress » paranovatos.com Says:
    September 25th, 2006 at 12:55 pm

    [...] Buscando una manera de paginar en WordPress porque en ocasiones me parece mas practico que la paginacion se presente 1 2 3 4 .. en vez de “pagina anterior – pagina siguiente”, me encontre este post WordPress Posts, Pages and pagination entiendase Post WordPress, paginas y paginacion, el cual daba un tip muy simple: si quieres paginar tu post (articulo), simplemente donde quieras paginar inserta la etiqueta [...]

  3. Search Engine Optimization for Wordpress Blogs Says:
    April 28th, 2007 at 2:37 pm

    WordPress Pagination Plugin For SEO…

    How well are your older posts being crawled by search engines?
    If your blog contains hundreds or thousands of posts you could be in DEEP trouble.
    Pagination will place your older posts deeper and deeper in your directory. Several layers or several doze…

  4. de ce? Says:
    June 8th, 2007 at 12:25 am

    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. Bryce Says:
    July 13th, 2007 at 3:36 pm

    Wow, so simple. Thanks for this. No plugin needed then for this.

    Thanks for the research

  6. Silveira Neto Says:
    August 4th, 2007 at 10:59 pm

    I reallly hate this function.

  7. mImran Says:
    February 15th, 2008 at 2:53 pm

    This for html formats meaning posts ending with html creates pages like …html/1 …html/2 not that good.

  8. ex Says:
    March 5th, 2008 at 11:43 pm

    Not good? That’s perfect! Thx for info!

  9. yMladenov Says:
    May 14th, 2008 at 1:53 pm

    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

  10. lee Says:
    October 25th, 2008 at 8:12 pm

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

  11. Skint & Demoralised Says:
    July 20th, 2009 at 4:10 pm

    [...] WordPress Posts, Pages and pagination | Article | ThinkLemon 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 … http://www.thinklemon.com/…/wordpress-posts-pages-and-pagination/ – Cached – Similar [...]

  12. Lampdocs Says:
    August 10th, 2009 at 3:14 pm

    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?

  13. Nga Says:
    March 5th, 2010 at 2:32 am

    vim to very

  14. Joanna Benz Says:
    April 16th, 2010 at 3:00 am

    This is the clearest explanation I have seen for the nextpage command. Thank you for posting it.

    For beginners who are unsure about whether to set up their site using posts or pages, this article might be helpful:

    http://unlimited-bandwidth-hosting.com/hosting-articles/setting-up-a-site/posts-versus-pages

  15. Wrecked Reviews Says:
    April 5th, 2011 at 8:41 pm

    Awesome, this worked wonders! Thanks for posting this!

Reply to the article or a commenter

Comment on this article

Please note that your comment may be withheld from immediate publication. Keep your comment on-topic/on-commenter and your comment will be published ASAP. (Off-topic comments will be deleted at the moderator's discretion. Please us the contact form if you feel your comment has been deleted unduely.)


Search

Are you looking for:

Recent Comments

  • Partnerseiten: I don’t even know how I finished up right here, but I...
  • Jaroslav Klokocnik: Gentlemen: we are very glad that thanks to Dr Rajmon (his...
  • Mike Flaugher: I’d like to find a way to filter by dates. I’m on...
  • made a post: Hello there, I found your site by the use of Google at the same...
  • Jayden Lawson: Also – just restart your browser after setting it to...

Recent Articles

Archives


ThinkLemon is proudly powered by pure will-power, determination and lack of direction in general. Furthermore, it sits on a piece of hardware, I have no clue where, that somehow manages to support a webserver, a scripting language, a database and therefore ... a tool to fill this space.

Entries (RSS) | Comments (RSS).