Using wordpress themes

This is a tutorial to explain how the themes work in wordpress 1.5. If you have just installed or upgraded wordpress and want to use themes on your site instead of regular php skinning, this is the tutorial for you.

Please note, ignore if it says otherwise in any of the 'readme.txt' or instructions file that you download along with a wordpress theme from my site. The new rule is that if you edit the colors, images or anything else in the original theme (its allowed) you still have to CREDIT ME for original coding. This inculdes but is not limited to use of menu or link box from some of my themes. The credit should be kept intact (not moved or editted), at the bottom of every page of your site. Thank you.

Installing themes

It is adviced that you read the php includes tutorials before reading this one if you have never used php includes on your site before. Now, lets begin with the tutorial. I am assuming that you have installed wordpress in a folder called 'wordpress' in your root directory.


Step 1: Login to your wordpress, click on 'options' and make sure that your wordpress address is set to http://yoursite.com/wordpress and your blog address is set to http://yoursite.com

Step 2: Now login to your ftp server and go to the wordpress folder. Download the index.php file to your computer.

Step 3: Open this index.php file that you downloaded, it should say something like this:

<?php /* Short and sweet */define('WP_USE_THEMES', true);
require('./wp-blog-header.php');?>


Replace the ./wp-blog-header.php with your full path like this /home/USER/public_html/wordpress/wp-blog-header.php ( Change USER with your username) so the whole code inside this index.php looks like this now:

<?php
/* Short and sweet */
define('WP_USE_THEMES', true);
require('/home/USER/public_html/wordpress/wp-blog-header.php');
?>


Save this file on your computer as index.php (Always remember to keep backups on your computer).

Step 4: Now download this theme. Open the .zip file and follow the instructions in it and edit the required files.

Step 5: Once you have editted the required files, follow the instructions and upload the theme to your wordpress/wp-content/themes folder.

Step 6: Now, if you want your whole site to be skinned using wordpress themes, you have to edit each page of the site.

Step 7: On top of every page add the following code:

<?php require_once("/home/USER/public_html/wordpress/wp-blog-header.php");?> <?php get_header(); ?>


After this code, the main content of that page is to be added (for example if its an avatars page, add only the html code that will show the avatars). Remember, only the content is to be added, this can be understand better if you know how to break a page (Please refer to regular php includes). Now, add the following code after the content:

<?php get_footer(); ?>


save this page as avatars.php (or anything else .php)

Step 8: The above page can be saved as a template and can be used to make all the other pages of site by just changing the content in it and not removing the php includes on top and bottom of it.

Step 9: Make all your pages like this and upload them to your ftp server.

Step 11: Come to your root directory, upload the index.php file that you editted and saved in step 3, to the root directory and overwrite the index.php which is already present in your root directory. (Always remember to keep backups on your computer).

Step 12: Now login to your wordpresss once again and click 'presentation' and select the pink-power theme that you installed from the themes list.

Step 13: Go to your site and you will see the theme on it. Check some of your pages to see if the theme works on all pages.

After successfully installing this wordpress theme on your site and 'skinning' your site using wordpress themes, you would now want to make new themes yourself and add them to your site. The tutorial 'making wordpress themes' teaches you how to do that. Go ahead and read that!


« Back