Installing and theming WordPress is easier than ever
with the release of Version 2.5


How to Install and Style
WordPress 2.5







Royce Tivel From: Royce Tivel

Date:


It's soon going to be time to redesign my web site, http://www.selectdigitals.com, for the Web 2.0 Age. I have seriously looked at two platforms with which to accomplish this: Drupal (http://www.drupal.org) and Joomla (http://joomla.org/).

Drupal and Joomla offer comprehensive packages that, in the case of Drupal, includes a blog and forum as core modules. Theming these platforms can be accomplished through both CSS (Cascading Style Sheets) and PHP (Personal Home Page or PHP: Hypertext Preprocessor) code modifications. However, these platforms are complex and learning enough to install, manage, and customize these platforms can be a daunting task.

wordpress.org After studying the two platforms, including using them both on my test bed platform and on the Internet, I decided to take a look at WordPress as a possible solution to my future Web needs. I was surprised to discover that the latest version of WordPress is easy to install, easy to use, and easy to theme.

In this article, I will show how to install and customize WordPress 2.5.




Install WordPress
in Five Easy Steps


(1) Download WordPress


Download Worpress The first installation step is to
Download WordPress. I created a directory on my PC called "wordpress" in which to collect the files and images I will use for my WordPress installation and customization. Once the download competed, I saved the .zip file.




Saving the Download


(2) Unzip WordPress


After saving the file, I opened it with the zip/unzip program I use, WinZip, and selected all of the files.


Unzip the Download


Since I will be testing and modifying Wordpress locally to begin with, I "Extracted" the files to the root directory of the Apache server I use for my PC test bed.


Extract the Files


If I were going to install WordPress "for real" on a live web site, I would have used an FTP client to upload the .zip file to the desired directory at my hosting service and unziped the file there. Firefox has a terrific and *free* FTP client, FireFTP, that can be used for the upload.


(3) Create the Database


At this point, the WordPress database needs to be created. WordPress requires a database to store the site content and other information. I use MySQL for my database server both on my PC test bed and on my live sites. I use phpMyAdmin as an interface to MySQL.

If the thought of implementing a testbed on your PC seems too intimedating, check out WampServer.

“WampServer is a Windows web development environment. It allows you to create web applications with Apache, PHP and the MySQL database. It also comes with PHPMyAdmin and SQLiteManager to easily manage your databases.”


Creating the database is really simple using phpMyAdmin. I simply start phpMyAdmin, enter the database name, and hit the "Create" button. WordPress will create the tables it needs in the database.


Create Database


(4) Create wp-config.php


WordPress needs to know how to access the database once it has been created. That's what the wp-config.php file is for. As shown in the image below, WordPress includes a file called "wp-config-sample.php." This file needs to be modified with the database access information and renamed to "wp-config.php."


Wordpress Directory


Open the config file with any text editor and modify the highlighted text. The critical entries are the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST.

As an enhanced security measure, I obtained a unique SECRET_KEY and pasted this into the file. I then saved the edited file as wp-config.php.

<?php
// ** MySQL settings ** //
define('DB_NAME', 'wordpress'); // The name of the database
define('DB_USER', 'rtivel'); // Your MySQL username
define('DB_PASSWORD', 'MyPassword'); // ...and password
define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');

// Change SECRET_KEY to a unique phrase. You won't have to remember it later,
// so make it long and complicated. You can visit http://api.wordpress.org/secret-key/1.0/
// to get a secret key generated for you, or just make something up.
define('SECRET_KEY', 'diq`~@|CH6)l@u>x;hA>1ew1maZ/)ToE!y%}}ZYAI!=V^L()eooB!0V+k8LJa!Eh'); // Change this to a unique phrase.

// You can have multiple installations in one database if you give each a unique prefix
$table_prefix = 'wp_'; // Only numbers, letters, and underscores please!

// Change this to localize WordPress. A corresponding MO file for the
// chosen language must be installed to wp-content/languages.
// For example, install de.mo to wp-content/languages and set WPLANG to 'de'
// to enable German language support.
define ('WPLANG', '');

/* That's all, stop editing! Happy blogging. */

define('ABSPATH', dirname(__FILE__).'/');
require_once(ABSPATH.'wp-settings.php');
?>



(5) Run the WordPress Installer


After completing the edit of the wp-config.php file, I started the installation script by entering this URL to my Apache server into my browser:

localhost/wordpress/wp-admin/install.php

For a live site, the URL might be something like this:

http://www.yourdomain.com/wordpress/wp-admin/install.php


The first installation screen asks for the blog name and contact email address.


Blog Title and Email


The next screen announces a successful installation and provides a username and password for the administrator. Be sure to save this password!


Username and Password


The installation is now complete. I can now log into Wordpress and begin managing the blog, customizing the theme, or adding content.


Login Screen


Back to Select Digitals Or, I can click the link at the top of the log in screen and go to the blog's home page.


Default Home Page


"Automatic" WordPress Installation


If you don't manually create a wp-config.php file, WordPress will prompt for the information it needs and try to complete the installation, as shown in the following screens:


No wp-config


Required Database Information


Database Setup Information


Run the Install


Blog Title and Email


Username and Password


That's it! WordPress should now be installed.




The Jakob Design



The current design for my personal web site, SelectDigitals.com, is based on work and philosophy of Jakob Nielsen. Nielsen's work has been dedicated to making usable web sites that deliver content that is easy to find and easy to read.

The design of Nielsen's site (and my site, by permission) is elegantly simple and has the primary goal of delivering content. WordPress also has the primary goal of delivering content. So, my first WordPress design will endeavor to maintain the look and feel of our sites with the added feature of visitor interactivity. I will refer to this as the Jakob design.

There are six major components that make up the look of the default WordPress blog:

  •  Header Graphic,
  •  Blog Title,
  •  Tagline,
  •  Page,
  •  Background, and
  •  Footer.

The image below shows these components.


WordPress Design Areas


In order to make the Jakob blog load quickly, I decided not to use a header or footer graphic; and since the design will essentially be the default WordPress theme with a new coat, little graphic design work needs to be done. In fact, I only needed to create one graphic to to generate the blog page with it's two column effect. The image below shows the basic page I'll end up with after the redesign is completed. The blog page "floats" in a blue background, indicated by the blue "frame" around the page.


New Page


Creating the Graphic


A look in the image directory for the default WordPress theme shows the default images used for the Kubrick look. For now, there is only one file of particular interest: kubrickbgwide.jpg. For the first, Jakob, design, the other Kubrick images are not needed but will be needed for the "Fancy", more complex design.


Default Kubrick Image Directory


The blog's page will be created from a "slice" through the center of the new design. The slice is a narrow image (40 pixels high) the width of the blog page (760 pixels). There are two columns in the Jakob design. The left-hand column is a yellowish color 510 pixels wide; the right-hand column is a bluish color and is 230 pixels wide. There is a small 10 pixel "bar" at each end of the slice that is filled with the page background color, a very light yellow.

I began my design by laying out the basic page in Adobe Illustrator, as shown below. I like using Illustrator for artwork of this kind, although other programs could be used, too. The "slice" is shown by the dashed lines.


Artboard


The image below shows the slice. The image is not full-sized and has a black border around it so that it will show clearly. Other images in this article will be resized as required and will have a similar black border (stroke) around them.


Page Slice


Renaming and saving the slice as kubrickbgwide.jpg has the following results:


Page with Slice


As new content is added, copies of kubrickbgwide.jpg will be stacked vertically to "grow" the two-column background. Only this one, small image will need to be downloaded for a browser to generate the blog's home page. The Blog will, therefore, load very quickly.

Pretty easy so far, right? The rest of the design will be accomplished through the theme's CSS file and/or through the WordPress administrative interface.


CSS Changes


The default CSS file is in the wp-content\themes\default\ directory. The CSS text below shows the code changes to style.css. The yellow highlighted text will be deleted or changed and the added or modified text will be shown with a green background. Before making any changes to the default CSS file, I always make and save a copy of the original. The CSS file can be opened and modified with any text editor.

/* Begin Typography & Colors */

body {
font-size: 62.5%; /* Resets 1em to 10px */
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
background: #d5d6d7 url('images/kubrickbgcolor.jpg');
background: #636f89; /* Set the Body background color to blue */
color: #333;
text-align: center;
}

#page {
background-color: white;
border: 1px solid #959596;
border:none;
text-align: left;
}

#header {
background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center;
}

#headerimg {
margin: 7px 9px 0;
height: 192px;
width: 740px;
}


#footer {
background: #eee url('images/kubrickfooter.jpg') no-repeat top;
background: #fffef2; /* Very light yellow */
border: none;
}

h1, h1 a, h1 a:hover, h1 a:visited, #headerimg .description {
text-decoration: none;
color: white;
color:red; /* Make the title red */
padding-bottom: .5em; /* Put a little space between the title and tagline */

}

.description {
text-decoration: none;
color: blue; /* Make the tagline blue */
text-align: center;
}



/* End Typography & Colors */



/* Begin Structure */

#page {
background-color: white;
background-color: fffef2; /* Very light yellow */
margin: 20px auto;
padding: 0;
width: 760px;
border: 1px solid #959596;
border: none;
}

#header {
background-color: #73a0c5;
background-color: #fffef2; /* Very light yellow */
margin: 0 0 0 1px;
padding: 0;
height: 200px;
width: 758px;
}


/* End Structure */


After making and saving these changes to the style.css file, the newly designed blog page, already shown above, is accomplished.




Testing the Jakob Design



Nothing ever goes wrong when a browser loads a page from the Internet, right? Even if this were true, it is still wise to consider how a page will display when the graphics can't be found. In the case of the Jakob design, if kubrickbgwide.jpg did not get downloaded, for any reason, the page would look like this:


No Graphic Downloaded


Because of the light background used for the header and footer (not shown), they display normally on the dark-blue background assigned to the body. However, the page content becomes difficult to read: it almost gets lost in the dark-blue background. A lighter background for the body might have been a safer choice.

The creator of the Kubrick design solved the missing-graphic problem by assigning alternate background colors to be used if the graphics were not available. Here is what the default Kubrick page looks like when no graphics are available:


Kubrick with no graphics


The assignments are made within the style.css file:

background color body { background: #d5d6d7 url('images/kubrickbgcolor.jpg'); }

header color #header { background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center; }

footer color #footer { background: #eee url('images/kubrickfooter.jpg') no-repeat top; }


If the images are not available, the alternate RGB color value will be used.

The default WordPress blog is still presentable and usable even without the graphics. In fact, for an initial page redesign, starting with the basic Kubrick design, without images, might be a good place to begin. This can be accomplished by simplifying the background code as follows:

body { background: #d5d6d7; }

#header { background: #73a0c5; }

#footer { background: #eee; }

The colors can then be changed to try out various blog color schemes. Just bring up the blog in a browser, change the RGB color codes, save the CSS file, and refresh the browser to see the changes immediately.

Another problem with the Jacob design is apparent when a single-post view is displayed. Without any additional CSS or PHP work, content viewed as a single post would look like this:


bgwide


By default, the Jakob design uses the two-column background image (modified kubrickbgwide.jpg) for both multi-post and single-post views. In the single-post view, text will flow into the blue, right-hand column. Even though the text can still be read, a single-color, light-pastel background would make the content easier to read.

Neither the default Kubrick or the "Fancy" design (discussed below) have the background problems of the Jakob design. The background colors and images have been chosen to be usable for both single-post and multi-post views in the absence of graphics.




Fancy Dress



Although I like the simplicity of the Jakob blog design, it will not appeal to everyone. Lots of people just love "glitz." The price of a fancy WordPress dress is often a slower loading blog with no increase in usability. However, for those who want to "dress up" the appearance of their blog, here are additional ways this can be accomplished.

First of all, it should be noted that the background of the default WordPress page uses header (kubrickheader.jpg) and footer (kubrickfooter.jpg) graphics. These graphics are not filled with a solid color, but with gradients. There also appears to be a very small drop shadow under the page.

Because of the complexity of the default page, additional graphics are required and, thus, additional slices are needed. Additionally, when a more complex body background is desired in which to "float" the page, a "seed" image for this might also be required (the kubrickbgcolor.jpg image can be used for this).


Fancy Blog Design


As before, I created a drawing of the blog page in Illustrator. The page, with rounded corners, floats on the default WordPress background, has a yellow gradient, and has a small drop shadow.

I first created a 760px X 600px rectangle on the Illustrator artboard. I filled this rectangle with the background color (C:8, M:6, Y:6, K:0).

Next, using the Rounded Rectangle Tool, I drew a 736px X 584px rectangle and filled it with the yellow gradient. Essentially, I made the page as large as possible within the background while leaving enough room for the drop shadow.

Finally, I gave the rounded rectangle a small drop shadow.


Blog Page with Gradient


Kubrickbgcolor In order to insure that the slices will merge perfectly into the body background, I created a 60px X 60px square of the same background color (C:8, M:6, Y:6, K:0) and saved it as kubrickbgcolor.jpg. The image will be used to "paint" the body background. This is an important step as the background used for the body and the background used for the page must match perfectly for this design.


Creating the Slices


Disable Stroke and Fill Using the Rectangle Tool, I placed a 760px X 200px rectangle on top of the layout described above. I positioned this rectangle at the top of the layout and used it to make a slice for the header graphic. Before doing this, I disabled stroke and fill.


Create Header 1


Create Header 2


Make Slice


I saved the slice as kubrickheader.jpg.

I created the footer and page slices in a similar fashion and renamed them as kubrickfooter.jpg and kubrickbgwide.jpg, respectively. Kubrickfooter.jpg is 760px X 63px and kubrickbgwide is 760px X 40px. The three images are shown below (resized to fit the page).

kubrickheader

kubrickbgwide

kubrickfooter


There are two other Kubrick images in the images directory: kubrickbg-ltr.jpg and kubrickbg-rtl.jpg (left to right, and right to left). These images are the same as kubrickbgwide.jpg. So, make two copies of kubrickbgwide.jpg and rename them accordingly.


CSS Changes


The default CSS file is in the wp-content\themes\default\ directory. The CSS text below shows the code changes to style.css. The yellow highlighted text will be deleted or changed and the added or modified text will be shown with a green background. Before making any changes to the default CSS file, I always make and save a copy of the original. The CSS file can be opened and modified with any text editor. For the Fancy design, the CSS changes are minimal.

/* Begin Typography & Colors */

body {
font-size: 62.5%; /* Resets 1em to 10px */
font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif;
background: #d5d6d7 url('images/kubrickbgcolor.jpg');
background: #e7e7e7 url('images/kubrickbgcolor.jpg');
color: #333;
text-align: center;
}

#page {
background-color: white;
border: 1px solid #959596;
border:none;
text-align: left;
}

#header {
background: #73a0c5 url('images/kubrickheader.jpg') no-repeat bottom center;
background: #e7e7e7 url('images/kubrickheader.jpg') no-repeat bottom center; }

#footer {
background: #eee url('images/kubrickfooter.jpg') no-repeat top;
background: #e7e7e7 url('images/kubrickfooter.jpg') no-repeat top;
border: none;
}

h1, h1 a, h1 a:hover, h1 a:visited, #headerimg .description {
text-decoration: none;
color: white;
color:red; /* Make the blog title red */
padding-bottom: .5em; /* Put a little space between the title and tagline */

}

.description {
text-decoration: none;
color: blue; /* Make the blog tagline blue */
text-align: center;
}



/* End Typography & Colors */



/* Begin Structure */

#page {
background-color: white;
background-color: #e7e7e7;
margin: 20px auto;
padding: 0;
width: 760px;
border: 1px solid #959596;
border: none;
}

#header {
background-color: #73a0c5;
background-color: #e7e7e7;
margin: 0 0 0 1px;
padding: 0;
height: 200px;
width: 758px;
}


/* End Structure */



After the design and CSS work, the page displays as shown below.


Fancy Blog


John Godley has written several articles that might be of interest to those who wish to install and theme WordPress.

Two articles of particular interest are “How to install WordPress on your own computer” and “Dissecting a WordPress theme”.

I worked through the “Dissecting...” article and learned an enormous amout about theming WordPress. The only problem I found was that there were a couple of CSS references to a class .entrytext that had been changed to .entry in WordPress 2.5. When I made the change, everything displayed as expected.






Yours for a more successful blog,

Royce Tivel

Royce Tivel










Select Digitals
261 SE Craig RD #3
Shelton WA 98584
(360) 426-1221

email address




Valid HTML 4.01 Transitional