Wordpress 101

Posted on February 14, 2007 
Filed Under Projects, Web development, Wordpress

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.

Mac Switching

Posted on February 7, 2007 
Filed Under Mac

I had heard the ads - they were all over TV. “Switch to a Mac”, yadda yadda, but then something shocking happened. A long time friend of mine, a certified windows guy, called me and said, “you have to go get a new Mac Book!” So I did… Then, I read all the blogs on top 10 Mac apps this, and switching from windows that and in the reading, a few things spoke to me, a web developer with a long background in administering Linux systems.

  1. Mac runs on a BSD kernnel
  2. Most of the things a sysadmin/web developer needs are already on a Mac “out of the box”
  3. The things that aren’t are easily downloadable (most for free)

So what follows is another what you need when you switch - list. “Wonderful” you say…but wait this one is coming from a perspective that I was unable to find when I did my “should I switch” googleing - from the perspective of a web/sysadmin.

First off, don’t do what I did and load Parallels with Windows “just in case you need it” - just put on your swim trunks, step the the edge, hold you nose or do whatever it is that you do, and step off into the great unknown. After a bit, you’ll want Parallels and Windows removed anyway (it’s gone off mine) - so save yourself the time, effort, and the 80 bucks.

Secondly, I am not going to blow smoke and tell you that “switching is seamless”, it’s not. When you get a new TV or a new cell phone, it’s different than the one you’re used to - so it seems odd at first. Same with a PC -> Mac switch. They are different machines you have to change a few things about yourself when going from one to the other, and if there is one thing that our little opposable thumb having group hates more than anything, it’s change (especially when we’re the thing that needs to change). Accept that there will be bumps, and deal with it - you’ll be happy you did.

Now moving on to the real issue here what do you need? I had four basic questions that I had to have answered before switching:

  1. How could the Mac sync with my Treo
  2. How could I remote desktop to a Windows machine
  3. How could I ssh to my Linux machines
  4. What application would i use for HTML authoring

The answer to the Treo Mac Sync was pretty easy. One of the guys at the Mac store knew of an application called Missing Sync. This slick little application will set ya back 40 bucks, but syncs seamlessly with the iLife suite that comes on the mac (including iTunes (although it obviously won’t play iTunes purchased encrypted music)) and it does it all over Bluetooth so you, like me, can loose your Treo Sync Cable.

The second question was fairly easy to answer too. Remember that friend of mine who is the windows sys admin? Well not so surprisingly, he knew how to Remote Desktop to a Windows box from a Mac. There is a dirty little secret that Microsoft is keeping…they have a site just for mac users called MacTopia. On that site you can buy office for the Mac (which you’ll likely need) but the real gem is a free, yes Microsoft and free, odd i know, little application you can download called RDC. Download, install and before you know it - you’re remote desktopping from a mac to a pc and you’d never know the difference.

Number three, although it should have been the easiest, took a little while to figure out. The ONE “gripe” I have with the Apple Store is that their “Mac Specialist” (the fine folks who answer your questions on the sales floor) are just that - specialists in using the Mac and iLife products - not specialists in how to use a mac for what YOU want to do with it. So when it came to answering “how do I SSH”…what i got was a lot of blank stares. Googling didn’t help much either and truth be told, I don’t remember where I found the very simple answer. It should have been obvious, as I mentioned earlier Mac OSX is basically Linux, albeit a very sexy Linux - Linux lives and dies by the command line - it would stand to reason that the Mac would too. Sure enough, just go to your Applications Folder -> Utilities Folder -> Terminal. It’s all built in. Pretty cool eh?

Now all I was left to figure out was a good HTML authoring program. This one was tough, not because there aren’t 100 great aps out there, but because I was used to using Homesite and I was comfortable with how Homesite worked and wanted a program that pretty much duplicated its features. I played around with a few; Text Wrangler, Taco HTML Edit and a few others. I ended up landing on TextMate - it’s similar to Homesite, is customizable in it’s look and has many different “themes” so you can control how you like your code to look. Recently I have also started using HyperEdit because it will show me PHP errors without putting the file up on a server (another benefit of the Mac - PHP compiler…included) - but I only use HyperEdit for debugging.

So after 5 months or so using the Mac, what do I think? Well, Parallels is gone, my windows laptop is sitting to my right and it’s turned off, and I am in the Market for a MacBook Pro. That should tell you more than any commercial right there…(paypal donations to MacBook Pro fund are being accepted :))

Helpful Links
http://www.coolosxapps.net/
http://www.versiontracker.com/macosx/

http://www.applematters.com/index.php/section/comments/10-essential-mac-apps/

Comments