Stirlyn Org*nix TechnoBabble

Archive for the ‘Wordpress’ Category

Thanks ifelse for the tip, which I now pass on to you. My Wordpress photoblog theme by brajeshwar is great and does exactly what I wanted which was to show one image on the front page, but only if you set your options>reading>show at most setting to 1.

This was fine for the front page, but I found it restricted the category and archive pages unless you had the Custom Query String plugin installed and activated. Not wanting to go the the trouble of installing anotherWordpress plugin, I decided to look around to see if there was another way of handling the problem.
I found the solution and if you follow these steps, you can have your Wordpress blog show only one post on the first page, whilst keeping the category and archive pages show as many posts as you have set in your Wordpress administration settings.

  1. Copy your theme index.php file to home.php which takes precedence over the index.php
  2. Insert the following code above the loop and save the page
    <?php get_header();?>
    <?php query_posts('posts_per_page=1'); ?>

That’s it! Now your front page will display only your latest post, whilst the remaining pages show the number of posts you set in your reading options.

Why is this necessary? Well if you are planning on getting good targeted search engine traffic to your site, creating a frontpage which is focused on your main search keyword or phrase is difficult to do if you have text on the page unrelated to that search phrase.

This is especially true if your site is not a niche site and tackles all kinds of discussion topics.

This works on Wordpress 1.5 and above. I hope this post hasĀ  been useful for all those who use Wordpress, but who don’t always want to install more Wordpress plugins than is absolutely necessary.