How To Make WP Show Only One Post On The Front Page?

advertisements

Follow the steps to make wordpress show only one post on the front page.

1) Make a copy of the index.php file thats in your worpress theme directory

2) Rename the index.php file to home.php

3) At the top of home.php, you need to make a call to query_posts

  1. REPLACE THIS CODE
  2. <?php get_header(); ?>
  3. WITH THIS CODE
  4. <?php
  5. get_header();
  6. query_posts('posts_per_page=1'); //returns only the front page
  7. ?>

The home.php file will take over the role of index.php and be used for front page display.

This way, you will not interfere with the number of posts shown on Categories and Archives if you had changed the number at the Reading Options.

You can easily change the number of posts per page by changing the (’posts_per_page=1?) to any number you want.

Category: How To, Wordpress
Stumble Delicious Technorati Digg Reddit socialmarker

1 Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

If you want to leave a feedback to this post or to some other user´s comment, simply fill out the form below.

(required)

(required)


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word