treehouse : what would you like to learn today?
Web Design Web Development iOS Development

[Solved] "Older Articles" Button

  • Hello,

    I was wondering if anyone knew how to get an "Older Articles" link for WordPress? Examples of what I mean can be seen by visiting these two websites: http://www.tuaw.com/ (Scroll right the the bottom "Older Articles") and http://www.cultofmac.com/ (Scroll right to the bottom "Older Posts").

    Thank you.
  • This is a very basic Wordpress feature. By default, the main page shows 10 posts, and then the "Older posts" link just goes to the next page of posts (usually at http://www.yoursite.com/page/2 ).

    So, unless you did some customization on your Wordpress setup, all you have to do to is to add this code:

    <a href="/page/2">Older posts</a>
    But I think that link should already appear on your site by default anyway.
  • That's exactly what I wanted but how do I get the page number to change within the hyperlink? So, if they go to page 2, how would I alter the hyperlink to go to page 3 when clicked?

    Thank you for your help, Senff.

    Morgan
  • This is standard Wordpress functionality, those links should show up automatically if you have enough posts, and you won't have to do anything for it.
  • Ah! I accidentally removed "<?php include (TEMPLATEPATH . '/_/inc/nav.php' ); ?>" from my index.php file. I didn't realise this was to do with page navigation.

    Thank you Senff.
  • There you go! :)