Vandelay Design

Customize Your Own WordPress Theme

Published July 18th, 2007 in Blogging, Design

An increasing number of businesses and website owners are using blogs as a means of communication with their customers and website visitors. If your business already has a website it is possible to have a blog that matches the look and feel of your existing website without doing a complete re-design and without paying thousands of dollars to have the blog developed. Using WordPress you can tailor an already existing blog theme to seamlessly flow with the rest of your website.

Why is it important to have a blog that matches the rest of your website?

1 – Maintaining the same design throughout your website will help to give your visitors a consistent experience and message while on your site.

2 – A more professional look can be accomplished by creating a customized theme that matches the rest of the site.

3 – By maintaining a consistent design throughout the site you will allow visitors to focus on the content of your blog rather than focusing on the design and layout changes.

4 – Many WordPress themes are used by hundreds or thousands of websites, whereas your custom them will be unique to your business.

5 – Using a blog layout that does not flow with the rest of your site may confuse visitors into thinking that they have left your site.

Understanding WordPress Themes

Editing and customizing WordPress themes can be very intimidating if you are not familiar with how they work. Essentially, when you are viewing a post on a WordPress blog you are seeing a combination of several different files within the theme. WordPress uses what they call The Loop, a php function that determines what the visitor is looking for and what should be displayed on the screen.

Although the WordPress system is very dependent on php, editing a theme does not require php knowledge. The php portion of coding is contained in easily recognizable portions of code. The html around the php can be changed to customize your theme to your website without changing the php coding. I will not be getting into the details of The Loop in this post, so please see the WordPress Codex if you need information and documentation on The Loop.

As mentioned above, WordPress uses separate files for different sections of the blog page. The header (portion of the page located above the blog post) comes from the header.php file. The blog post (or posts, if you are looking at a homepage or a category page) comes from the MySQL database. Most themes contain a sidebar.php file that appears next to the blog post, either to the left or the right. And the footer.php file contains the information that appears below the post and the sidebar.

Together the header, sidebar and footer files form a template that is applied to every page (although some themes are set to not show the sidebar in certain situations). Because of the template-like structure, any changes that you make to header.php, sidebar.php and footer.php will be reflected on all of your pages. This makes the customization easier as you really only have to customize the template.

Throughout this article we will be looking at a sample blog that I customized for a client from the Kubrick theme. The customization was done to match their existing website. This picture shows which parts of the page are in each of the WordPress files.

Breakdown of a WP theme
Once you understand how these files come together to display in the browser, all you will need to do is adapt the design to match your existing website.

Installing WordPress

If you haven’t already installed WordPress you can do so at http://wordpress.org/download. For this website we use Host Gator (affiliate link), which provides an easier WordPress installation.

WordPress comes with two themes, Default (also known as Kubrick) and Classic. The Kubrick theme is a good starting block if you are creating or customizing your own theme. It is a fairly simple theme with clean and valid coding that has been used by thousands of bloggers. Almost any problem that could possibly occur with Kubrick has already been found and corrected.

However, if your existing website has a more unique design you may want to look for a theme that more closely resembles your layout, which can make the customization easier. You can find a gallery of free themes at http://themes.wordpress.net.

Breaking Down Your Existing Design

Since we know that WordPress sees the layout as a combination of a header, a body (blog posts), a sidebar and a footer, visualizing your existing website in the same sections will make the customization possible.

To start, take a page on your site that you want your blog to match and remove the content of the page. Leave the structure of the design and any images and navigation menus that you want to use on your blog. The blank space where you removed the content is where your blog posts will go. Anything above that will need to be included in the header.php file. For example, the header.php file of our blog theme includes the navigation menus and everything above. The picture below shows the portion of the design that is contained in header.php.

Our Header

Note: This is an older post and the design has since changed. The concept, however, remains the same.

If you’re working with Kubrick, the header.php file also contains the CSS code for the page’s background image. Most likely you will want to replace Kubrick’s background image with your own.

Chances are your existing website already has some type of sidebar. The sidebar may contain your primary navigation, text links to various pages, an email sign up form, or just about anything. Some of these things in your existing sidebar you will want to include in your blog sidebar. The blog sidebar by default includes a search box, links to pages that categorize your blog posts, a blogroll (links to other blogs), and some metadata that includes your login link.

To add content to your sidebar, open sidebar.php. If you are working with the default Kubrick theme your sidebar consists primarily of html code for an unordered list and php code. The php coding is used to generate links to your categories and archive pages. Any html that you want to add can be added in the sidebar, but it should not be placed inside php code.

For example, in our blog theme we added a form that allows visitors to sign up to receive our blog feed by email (a service that is provided by FeedBurner). In this case we simply inserted the code for the form, which was provided by FeedBurner, at the bottom of the sidebar. Editing your sidebar is pretty straightforward as long as you make sure that the html coding you add is valid and does not interfere with what is already there.

You can also remove any of the items in the sidebar that you do not want. If you don’t want to have a search box, remove the small piece of php coding that includes searchform.php. For our theme we chose to remove the blogroll.

The footer is edited in much the same way. The footer.php file for the Kubrick theme contains very little coding. The php coding that is in footer.php is only there to gather the name of your blog and to provide a link to your RSS feed. This coding can be removed if you like and any html that you wish to use for your footer can be entered here.

Editing the Style Sheet

Every WordPress theme includes a CSS file, style.css. This file controls the look of the entire theme. Most of the changes you will be making to customize your theme will be done to style.css.

The style sheet for Kubrick is very user-friendly when you’re trying to customize the theme. It is broken down into the following categories:

- Typography and colors
- Structure
- Headers
- Images
- Lists
- Form elements
- Comments
- Sidebar
- Calendar
- Various tags and classes

With this type of organization it is easy to find what you are looking for in order to make changes.

Editing the styles to create your custom theme will take some experimentation, so it is best to create a test area where you can make mistakes and not affect anything. If you already have an existing blog do not attempt to make changes to a theme while it is currently selected as your blog theme. My recommendation is to install a WordPress blog in a folder on your site that is strictly for testing purposes. This way you can make changes to the style sheet and php files, update them to see how you theme looks, and not have to worry about causing any problems with your existing blog.

The CSS file for a WordPress theme works the same way as any other CSS file. Where you could run in to problems is in the naming of the divs and classes. Most likely when you are customizing a theme you will be leaving some of the structure in place, and you will be adding some of your own. For example, the header.php file for Kubrick contains a header div and a header image div. When you are customizing the header to add what you want you can either use the existing structure, or you can create your own. If you use the existing structure, anything in the header div will still be styled under the existing CSS file until you change the CSS to meet your needs.

In our example site everything we added to the header file, picture, navigation and search box, are all contained within the header div. To customize the header.php file we then changed the height and width of the header div to meet our needs, as well as changing the background image and color. If you’re used to working with CSS this process is not too difficult. Everything you see in the picture below is in the header.php file.

Blog header

The key to customizing the theme is breaking it down into pieces – header, sidebar, post area, and footer. Work on one piece at a time with the appropriate file and the CSS file. Once each piece is completed you will have you own customized WordPress theme.

74 Responses to “Customize Your Own WordPress Theme”

Lee July 24th, 2007

Creating your own look with wordpress is easier than you think. I like the way you have demystified the process.

Thanks for the info see you in the Make money bogging 101 blog carnival .

Vandelay Design July 24th, 2007

Hi Lee,
Thanks for visiting and for the carnival!

dude alert! July 26th, 2007

hey.. im doing my own theme for wordpress and i must say, thanks for the tips you have wrote here.

and good post.

Vandelay Design July 28th, 2007

dude alert,
Thanks for your positive feedback. Good luck with your theme.

Vandelay Design July 28th, 2007

Austin,
I’m not quite sure exactly what your question is. It looks like the link you provided is a brand new WordPress blog just created today. If you’re not sure what to do, check out the WordPress Codex. It’s the best way for a beginner to get some info. Also see our article, New WordPress Blogs: 12 Steps to Set Up for Success. Hope that helps.

Prestamos October 16th, 2007

Can you refer some companies where I could be able to send my psd wordpress design and they will make a wordpress theme for me ?

Thanks.

Jenni November 1st, 2007

Thanks for the excellent, helpful info! Is there any chance that YOU would be hire-able to change the header on my blog for me? If so, feel free to email me so we could chat about the prospect.
Thanks!
Jenni

Vandelay Design November 1st, 2007

Hi Jenni,
I just sent you an email.

Jenny November 7th, 2007

I did that to mine. :) Works pretty well even though it’s simple and stupid.

Alberghi November 9th, 2007

It’s really good article, itryed to do it with my blog and i have good results in few days.

SirCommy December 12th, 2007

It is almost vital to make your blog match the design of your current site. Well, quite depends on your content and site’s intentions. A theme can be easily modified, but you’ll need some patience of course. It took me a whole day, not that much, but accomplished an unique and related design to one of my sites. Good post.

Dominico Hastings January 6th, 2008

That’s some nice detailed information there. Thanks.

Dominico Hastings January 7th, 2008

Would you recommend hosting a blog on a wordpress subdomain or using your own domain?

Klaus January 8th, 2008

Thanks for the good description and ideas.

Prinz January 8th, 2008

detailed infos, thanks

Florian January 10th, 2008

Thanks for that informative post. Where can we find an overview about themes, especially themes with an german language file included.

cewekndeso January 12th, 2008

your tips its so helpfull thank you so much. even i havent done yet join for the wordpress but i like to learn it how to make my own themes.

JBiggs February 6th, 2008

I’m very enjoy reading this content.
Thank you for good information :)

Karl February 25th, 2008

Thank you for this – just in time, as we completed the redesign of our site a week or two ago. It’ll be great to have someone else’s guidelines to follow, as it’ll speed the process markedly.

Harry February 28th, 2008

hi i have a website and i am new to wordpress. i want to rebuild my existing website with wordpress. But the problem is that i dont know where to start. Please help me, i had installed wordpress on my system and what is the next step

sheds April 9th, 2008

your own wordpress theme would definately reflect your business.

em dash creative April 10th, 2008

Thanks so much for the info, I’ve found it very helpful.

Designer-artist May 15th, 2008

Certainly it would be desirable to have design corresponding your maintenance and that mood which is to be transferred users.

Most easier to find an available theme for WordPress, the main thing to look at configuration and to make a start from it: to change the pictures, to replace backgrounds, to make redesign of a site.

As a result – the individual website!

Web Design Company July 24th, 2008

Thanks for the info. I would request you to help those with blogs on blogger as I have often heard that wordpress allows many things to customize the blogs as compared to blogger where the options are limited.

ReviewPage.com September 15th, 2008

Awesome job! Keep it up!

julie December 5th, 2008

With regards to this part of the article “To start, take a page on your site that you want your blog to match and remove the content of the page. Leave the structure of the design and any images and navigation menus that you want to use on your blog. The blank space where you removed the content is where your blog posts will go. Anything above that will need to be included in the header.php file. For example, the header.php file of our blog theme includes the navigation menus and everything above. The picture below shows the portion of the design that is contained in header.php.”

What do I name that page and where do I put it??

Vandelay Design December 5th, 2008

Julie,
If you’re talking about the header, it’s header.php. if you’re asking the name of the homepage, it’s index.php. If you open up the index.php of a WP theme you should see php coding were it is pulling in the header, the sidebar and the footer. Does that answer your question?

shams December 13th, 2008

this is the great thing i admire this

serhat January 27th, 2009

this is great article thanks for sharing with us

Tierney February 6th, 2009

Hi, I’ve been searching the net for answers to my question when I found this site. Hopefully, I can find the answer here. :) I would like to add a sidebar on my blog page but couldn’t figure out how to do it. No, I don’t want to change the sites theme just the blog page. Anyone who knows how to do this? Here is my website: http://tierneyomalley.com

Thank you,

Tierney

Vandelay Design February 6th, 2009

Tierney,
Looking at your site quickly I think you need to add the sidebar code to the single.php and page.php files.

Tierney February 6th, 2009

Hi Vandelay Design,

Good morning. Thank you for the reply. Mind telling me what those codes are. :(

Lifestyle March 3rd, 2009

Good article how to customize your wordpress blog.
Thank for that Vandelay Design

Steve March 6th, 2009

I’ve been searching around for info just like this; thanks for the straight forward facts!

Glad I’ll be able to combine my Dreamweaver/CSS knowledge into learning WordPress :)

I have really found your post on customisation of my wordpress themes helpful. Fo sure I have started customising my theme that I downloaded basing on your instrutions. You have made it look so easy and simple.

Kaplang August 9th, 2009

thanks for the tips :)

beginner October 27th, 2009

customizing an existing Wordpress theme rather than buying or creating a new one will indeed save you time and money!

danny October 27th, 2009

Pls can some1 email me if he can customise a wordpress theme for me ?
mail to dannyogolo (at) yahoo (dot) com

Hans November 7th, 2009

basic tutorial, but so useful, newbie for wordpress must get much tutorial from here, so do I.

Trackbacks

Leave a Reply