Jan
13th

WordPress: Build a Home Page in 3 Easy Steps

Thanks for stopping by my personal blog on Marketing Technology! Over 50,000 visitors a month find my content worth returning for, so don't forget to subscribe to the Marketing Technology Blog RSS feed or to the Marketing Technology Email to have new content sent directly to your inbox. You may also find my other business blog helpful, Social Media Domination.

Home PageI was working on a site for a friend today who had WordPress but he wanted a simple home page rather than a home page utilizing the latest blog entries.

This is really useful if you’d like your blog to be a part of your site rather than the entire site. You can basically utilize WordPress as a CMS. Below I concentrated on ‘3 Easy Steps’ so if you’re an advanced developer who utilizes WordPress, don’t give me a lot of guff. :)

Some people really go through some difficult steps to do this, but there really is a simple way… here’s how using the default theme:

  1. Copy your Page Template (page.php) to a new file called home.php and put it in your theme directory. This is a supported feature of WordPress… it will look for home.php first if it exists.
  2. Make a new Category and call it Home Page. Remember the Category ID number… you’ll need it in the following code.
  3. Overwrite the Loop in home.php with the code below. This basically filters out any other content except the content posted to your new Category called Home Page. Be sure to substitute the Category ID below in the quotes in the cat=1 statement. I also asked to sort the posts ascending since that’s more appropriate.

That’s it! You’re done! If you only want a single article on that page, just write one post and update it whenever you wish to update your home page! Voila!

Code (Updated 1/15/2007):

<?php query_posts(’cat=1&order=ASC’); // include home page only and sort ascending ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><?php the_title(); ?></h2>
<div class="entry">
<?php the_content(’<p class="serif">Read the rest of this page &raquo;</p>’); ?>
<?php link_pages(’<p><strong>Pages:</strong> ‘, ‘</p>’, ‘number’); ?>
</div>
</div>
<?php endwhile; endif; ?>

If you’d like a plugin for assisting in making a home page, you can utilize this one.

RSS feed | Trackback URI

4 Comments »

Comment by no imageAshish Mohta (SezWho)
2007-01-13 23:03:33

I want to create a home page using flash…like Nokia has.Any idea how to do it?
Rate this:
2.9
 
Comment by no imageDouglas Karr (SezWho)
2007-01-14 11:07:13

I’m no flash expert, Ashish… but you definitely build a splash flash page that autoforwards to your blog or has a link to your blog in your flash file.
Rate this:
2.9
 
Comment by no imageBourbon Hipster (SezWho)
2007-01-17 11:41:36

Doug,
You are a mensch for sharing this.
Rate this:
2.9
 
Comment by no imageAustin Kansol (SezWho)
2007-07-28 15:52:58

HOW DO YOU MAKE YOUR OWN HOMPAGE??!!?!!!?
(please reply)
Rate this:
1.6
 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.

My Comment Policy: I moderate comments. Please be patient:

  • Spam will happily be destroyed.
  • Use your real name, not some keywords. Otherwise it will be destroyed.
  • Mean comments aren't necessary. If I don't post them I will reply personally to let you know why.
  • Lewd comments will be edited, I don't want my readers leaving because of offensive content.
Great debate, criticism and colorful commentary is always appreciated and approved!