My home page is being build on index.php. I have a wordpress loop somewhere there, because I want to show the two latest posts. So my problem is that my homepage is being paginated. I don't want that.

I want my homepage to act as a homepage. Lets say my homepage is example.com, and shows the latest 2 posts example.com/page/2/ it show the previous two. I've added that code in the top of the index.php but is just a redirection. I want the pagination just disabled for that specific loop. How can I achieve that?

Thank you

<?php if ($paged > 1) { header('Location: /blog'); exit; } ?>


1 Answer 1


Make use of the WordPress template hierarchy, by either having a home.php - home page - or a front-page.php - front page - to display the site home/front. Read the WordPress codex article Creating a Static Front Page for an insight on how to do it and some explanation about the differences. Do not use any pagination code - see the according section from the before mentioned article.

  • So i'm making a front-page.php template, create a page, and assign that page as Front Page in settings->reading right?
    – hambos22
    Apr 1, 2015 at 12:29
  • Did you read what I linked? @hambos22 Apr 1, 2015 at 12:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.