When I first started learning WordPress themes I was lost. Where to start? Well, the first thing I learned was the theme structure. The most basic theme is made up of six key files:
1.The Cascading Style Sheet (CSS).
This file determines how your theme is rendered. Here you change the color of fonts, the placement of images, and how wide your content area will be. All of your theme elements should be listed here.
2.The header.php
This file holds valuable page information for browsers, robots and crawlers. It also is where the body tag of your page will appear, as well as the title tag and other important opening divs.
3.The Main Index.php
This file holds all the code for your homepage.
4.The sidebar.php
This holds the code for your sidebar. You call this template in the main index.php.
5.The comments.php
This is the comments template. It's called in the index.php also and is used to render the comments area on your blog.
6.The footer.php
This is where your page ends. Here is where you put such things as your site Copyright and your end body and HTML tags.
Now that you know the most basic layout and what each file is used for, you can begin learning how to design and code. A great resource for this is the codex at WordPress.org. However, the tutorials there are more advanced and can be quite daunting. You could soon find yourself lost and quite possibly throwing your computer out a window. There's an easier way to get to know the theme files. [Please note that this tutorial assumes that you have a basic knowledge of HTML and CSS.]
You'll need an HTML editor if you aren't an expert at CSS and HTML. I use NVU to get everything just right. Also, download and install two more browsers- Firefox and Opera - in addition to your Internet Explorer. Many people use these browsers and you'll need to see how your page renders in them. You'll also need your favorite theme files. You'll be reworking these. Make sure that the designer allows for tweaking by looking for General Public License (GPL). Most themes from the WordPress codex have these, but check anyway. If your favorite design has this you can begin tweaking.
Open up NVU and go to the source code. Write Copy and paste your CSS between the style tags. Then copy and paste your header.php under the tag. Do the same with the main index.php, sidebar, comments, and footer- in that order. It's very important to keep the structure of the page intact. To make the end easier put comments between each section. Commenting in HTML looks like this:
All of your tags are already in there so you should be able to go to the 'normal' tab and see your page rendered (it won't look exactly like it will when you've gone live because the php tags don't render). That's ok. We just need to concentrate on the styling. The only reason you're structuring a page like this is so you can see how changing the CSS will change your entire page. That's the important part.
Make sure you're on the 'normal' tab and the go to 'tools -> CSS editor'. There's a plus sign ( + ) beside index, so open that. There you'll find all the elements in your CSS and on your page. This is where you'll style. You go through the different elements and design them the way you want them. Watch your page change with each change. Experiment with the borders, boxes, backgrounds, etc. This is where your design ideas come to life. When you're finished save the document and open in your different browsers. Again don't worry about the php code showing up.
When you have everything the way you want it, copy the CSS page and put it into theme on which you were working. This can be done in the WordPress presentation tab if you have the correct permissions. If not, then use an ftp client and edit it through there. View your site. If everything went as planned your design tweak will look exactly the way you want it. Congratulations on your accomplishment!
Please keep in mind that tweaking someone else's design doesn't make it yours. Coding a theme can be hard work and you should respect the designers work. Simply leave the credits to them and add that you've done the tweaking. For instance, "Designed by Lizzie Flynn and personalized by Joe Smith" would work just fine. The theme was probably free so recognizing the work of the person who made it is very important.
Now that you've taken that first leap, WordPress themes shouldn't seem so scary. So, now you can head on over to the codex and learn what all that code means. Soon you'll find yourself creating the pages instead of just tweaking them and all the credit can be yours. Have fun!
Published by Lizzie Flynn
Lizzie is an accomplished Web designer who enjoys designing and coding WordPress themes as well as hand-coding sites from scratch. She received her degree in Computer Technology with a concentration in Inter... View profile
-
How to Build a Custom Wordpress Theme for Your Blog
The average web developer charges anywhere from $300 to $1,500 to build a custom Wordpress theme. If you have just basic knowledge you can build your own custom theme at home fo...
- How to Correctly Install a WordPress Theme If you're having trouble installing a theme for WordPress, or are just unsure of how to do so, this tutorial/how-to will explain exactly how to do it.
-
Top 20 WordPress Templates of 2008
The top 20 listed in this site offer a variety of choices and options for all age ranges, interests and uses.
-
Creating a Simple Template System in PHP
Templates make creating web pages so much easier, especially if you are looking for a nice, uniform appearance. So, lets learn how to create a system to do just that!
- How to Design a Retro Kitchen Want some different DIY Decorating Ideas on how to design a retro kitchen? Here are the steps to help decorate vintages style, with 4 Do-It-Yourself tips!
- Choosing the Best Theme for Your Wordpress Blog
- Wordpress Themes You (Probably!) Haven't Seen Before
- How to Make Money with Adsense - the Ultimate Guide to Passive Income
- Why You Should Not Pay for Wordpress Themes
- Change from Blogger to WordPress, the Easy Way
- Starting a WordPress Blog
- Is Wordpress Really the "Do Everything" CMS? 4 Ways to Use Wordpress that Isn't Bl...
|
|
- LinkedIn's 4Q revenue doubles, stock soars 8 pct (AP)
- Brazil files injunction against Twitter (AP)
- Kodak to stop making cameras, digital frames (AP)
- Just Show Me: 3 great photo apps for the iPhone (Yahoo! News)
- Origami Bots: Paper robots running on air slither and slide their way to missions (Yahoo! News)
5 Comments
Post a CommentWell written article
interesting and very useful...thanks
;-)
You're welcome! I'm glad I could help.
This was very helpful. I may experiment with designing my own template one of these days, and now I know where to start. Thanks!