First you’ll need to make a copy of the index.php file in your theme directory. Rename this file home.php. This file will take precedence over index.php and be used for the front page display. Now, at the top of this file, you’ll need to make a call to query_posts, and that’s what i used in my last WP theme Orange Glossy.

  1. <?php
  2. get_header();
  3. query_posts(’posts_per_page=1′); //returns only the front page
  4. ?>

instead of

  1. <?php get_header(); ?>

We’re using the posts_per_page parameter to request that only a single post is retrieved and populated into the query object for The_Loop. So why not change the reading options in the WP Admin panel? The reason is because this will also affect the pagination for searches and archives. Query_posts offers a simple, elegant solution to this problem. And you can easily change the number of posts per page by changing the (’posts_per_page=1′) to any number you want.

Related Articles: