Wordpress 101

February 14, 2007

The developers at {iW} Invisible Window are continually making improvements to our CMS (Content Management System) called EMPOWER and we are quite proud of it. There are times, however, when the requirements of a project lend themselves more towards another similar, yet different system. Often times the transition point is in whether or not a project will have a BLOG. There is no point in re-inventing the wheel and Wordpress is a fantastic piece of BLOG software right out of the box. Upon first glance, however, it is not intuitive as to how to harness the power of Wordpress and use it for a full featured CMS system. As we were in the process of building our own site (which features a Wordpress CMS backend) we did lots of Googling to to become familiar with the process. Our Wordpress knowledge couldn’t have been gained without the help of other developer’s blogs. What follows is a step by step how-to on setting up a site and using Wordpress to manage it. Should you stumble along the way, the Wordpress Codex is your friend.

First, obviously, you will need to get Wordpress and install it. If you’re new to Wordpress, take a moment to play around with the interface. Familiarize yourself with the features, at this point in time you should be able to view your blog, login, make posts, and add pages. Now before yo get too far along…let’s start customizing.

The home page of your new site should now be your most recent blog postings – it’s pretty cool – lots of great information on that page. Generally speaking, a web site’s home page acts like an information kiosk – directing visitors to where they want to go within your site – a “recent blog posts” for your home page won’t really accomplish that goal. Home pages have very different jobs than the rest of the pages on a site and need a different look to do this job properly. So without further ado, let’s get a unique home page for our new site.

In Wordpress version 2.1 which is current as of this writing, creating a unique index page is quite simple. How to do this is covered in detail here (on the Wordpress Codex) and here (in the Wordpress support forums) (if you visit this link – skip forward – the beginning of the thread is from over 2 years ago and reference Wordpress 1.5). Here are the steps in case you don’t want to wade through all of that info.

  1. In your Wordpress admin, create a new page. Put some content on it (you can always go back and edit later) and save it – (Call it “Home”)
  2. In your themes directory (WordpressRoot/wp-content/themes/YourSelectedTheme) copy your page.php page and name it home.php
  3. Using your favorite text editor, Edit your new home.php page and right after the code for the header
    get_header();
    ?>
    insert this
    query_posts('pagename=Page Name');
    ?>

    Where “Page Name is the name of your page (ex. “Home”).

  4. Save home.php and with your favorite FTP application, upload it to your web server.

That is it. You should have a unique home page now.

Now that you have a unique home page maybe you want the navigation to each of your pages to show up. Now explaining EXACTLY how to do this is tough because there are nearly a zillion Wordpress themes out there and the code behind each of them is just a little bit different from the next. The following code is the key:

generally this code should go in your header file (WordpressRoot/wp-content/themes/YourSelectedTheme/header.php) but again – lots of themes – lots of different ways to do it (so we’re not spending too much time on it).

Now – you have a unique home page – you have your pages showing as nav, what if you want to call your blog something other than “BLOG” and what if you want it last in your navigation list (or as the Codex refers to it ” Making your blog appear in a non-root folder”)? Well it begins much like making a unique home page.

First, create a blog template. The easiest way to do this is to create a file named blog.php with the following contents in your theme directory:

/*
Template Name: Blog
*/
// Which page of the blog are we on?
$paged = get_query_var('paged');
query_posts('cat=-0&paged='.$paged);
load_template(TEMPLATEPATH . '/index.php'); //loads index
?>

Log into Wordpress and create a page named “Your New Name For Your Blog” with template “blog”. You’re done. The one last thing you will want to do is to update your permalinks structure to begin with “/blog/”, ie, “/blog/%year%/%monthnum%/%postname%/”. How you ask? Easy! Log into your admin system – Click on the “Options” tab, now Click on “Permalinks” then select the “Custom” radio button and enter this in the text field “/%postname%”. Voilla, done! Now you have a Wordpress-managed CMS with a unique front page and logically-structured blog content. Not only does this make your site appear better, this logical format of URL display should also help search engines catalog your site.

I think that’s going to do it for Wordpress 101. Look for Wordpress 102 to come in the following weeks. In that lesson we will address:
Unique pages (how to put Wordpress administrated code into your side bar etc.)
Portfolio (how to put thumb nail images in your side bar and display full images in the content area)
Customizing the Templates (we’ll cover a bit of everything here).

See you soon, and don’t hesitate to leave comments, I will try to answer them all to the best of my ability.

This is not necessarily part of Wordpress 101, but it is a great tutorial on how to install and configure Wordpress.

Leave a Reply

You must be logged in to post a comment.