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

Found an error on your WordPress lynda tutorial

  • Chris,
    Just watched the "Creating the blog home page" on lynda.com and you mention to use query post to display the latest 5 blog posts. However, if I have 6 post and hit the "older entries" link, the lastest 5 show up again and NOT the 6th one.

    In other words, pagination doesn't work with query post. Is there a fix for this? I am wrong? I'm googling now, but thought you might want to know.
  • Check out this podcast. Chris covers basic pagination here.
  • Thanks. I was having a hard time working with offset. It wasn't really working for me. I found this great though!

    Here is my solution btw:


    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("posts_per_page=3&paged=$paged"); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>