Hi, how many of you have felt the need to create a new wordpress template/theme and felt that the structure is too intimidating? We had the same feeling too until we realised how easy it is to create a wordpress template. (I also presented this at the BlogCamp 2006, Chennai)
A few things before you need a template are:
1. Figure out the layout of your blog. That is, you should be clear about what should be placed where. Ofcourse, it’s entirely at your discretion.
2. Create a simple HTML page that show cases your layout.
3. Mould the simple page into a beautiful wordpress template.
Ready?? Ok, let’s start!
As said in point 1, I have just created a basic layout as shown in the screen shot below.
You can definitely tell about the various sections that make up the page. They are the header, content, sidebar, footer. To abstract this and give power to the template designers, wordpress has placed the various sections into different pages.
In addition to this, you have to add proper CSS to your design. Include them in “style.css”.
Therefore, the files necessary are:
1. header.php -> Header
2. footer.php -> Footer
3. sidebar.php -> Sidebar
4. index.php -> Content glued with header, sidebar and footer.
5. style.css -> CSS
That is all you need to create a basic template. Clear? Any doubts? Post them here.
Designing the Template:
The HTML for our basic layout goes like this:
Have a look at the simple style sheet for the basic layout. Save this as “style.css”. We would need it later.
Now that you have saved it, open the HTML file in a good text editor. You can see sections that are tagged with “header”, “footer”, “sidebar” and “content”. Let us create the header file.
1. Open notepad, and paste the code shown below. Save this file as “header.php”.
2. Copy the fragment below and save it in a new file as “footer.php”.
3. Copy the sidebar code and save it in a new file as “sidebar.php”.
4. Last but not the least, let us create the “index.php”. If you notice, there are special lines such as “”, “”, “”. These are the functions that are used to glue the content with header, sidebar and footer. Great! we are almost done… few more minutes.
5. Create a new folder and name it as “DarlingTemplate”. Move all the newly created files, including the “style.css” to the folder. To test the new template, upload[:1] this folder to the /wp-content/themes folder. Login to your blog and you will see the new template under the “Presentation” tab.
6. Click on our template name to activate it. Well, everything is cool. The template looks just like the simple HTML file we created earlier. But, what happened to the posts?
7. Open up “index.php”, replace it with the text in the following box and save it. Make sure the modified file is uploaded to the /wp-content/themes/DarlingTemplate folder. Refresh the blog homepage. Voila!! the posts are there.
8. Oh! we are still left with 30 seconds. Take a screen shot of your theme. Save it as “screenshot.png” and upload it to
/wp-content/themes/DarlingTemplate.
Now, when you login to your wordpress account, our template will have a medium sized thumbnail picture.
We have uploaded the final sample template as a zip file for your reference. Download it here.
This is how the final version of DarlingTemplate looks. I know it’s not professional, but you have learnt the basic tricks of building a new template.
Happy Templating!
Note:
1. You cannot upload the new template if your blog is hosted at wordpress.com.
2. How to Ajax -ify your wordpress template - coming soon.
Hack the Bot: wordpress, template, design, webpage, html, coding, php, css, tutorial, DIY, tips, tricks, hacks, how+to
Technorati Tags: WordPress Template, Template design, webpage design, tutorials, diy, tips, tricks, hacks, how to, html, php, coding, wordpress, Theme.
Filed under: DIY, Extras, Hacks, How-To, Monthly Spl., blogcamp, wordpress |
Can’t download de zip file!
Nice tutorial anyway.
@bc:
Thanks for pointing it out. You can download the sample at http://www33.brinkster.com/aswinanand123/DarlingTemplate.zip
sweet! I have been scouring the web for a quick tutorial for people with short attention spans! This tutorial was a life saver!
thanks!
If anyone wants a real life endorsement of this tutorial - look at what I was able to whip together in about 40 minutes: http://www.enochbenjamin.com/blog/
@enoch:
btw, its pretty ok.. considering that you took just 40 minutes to build it
Thanks
Great tutorial, thanks for the info.
I have a question though, I was wondering if it would be possible to start designing a template using the “slicing” technique? The difference then would be that we will have tables instead of DIV, would that be a problem? any tips or suggestions?
The way I normally design websites is that I start producing the design in photoshop, slice the design and export as HTML. Not sure if I can follow the same approach in creating wordpress themes.
Thanks.
@James:
Thanks James
You can actually use the slice technique. After you place the contents of header, footer etc. in the different files and activate the template, reload your blog. Now, on the browser menu, click on View->Source. You can see that the generated HTML code is valid.
So, first build your simple html file. Then slice it into different pages/images and put them in the respective files. That should be it. We use because its easier to apply different kinds of CSS to the same layout.
I tried to download your files, I download them then use stuffit expander to uncompress the files and I get the message.” The file “DarlingTemplate.zip” does not appear to be compressed or encoded. It is advised that you obtain further information about the contents of this file from the sender or provider of the file.
It should be noted that I am using a mac. Please help!! I too am a n00b at theme stuff with wp, but know a good amount of HTML, CSS and I am a graphic designer. Thanks for the help!!
I love you. I was falling asleep trying to work this out and you just woke me up and re-inspired me into thinking it’s easy again.
Let’s just see if I can actually get my template to look like what my head says it should look like…
whats the best php scripts website?
Thanks so much for this tutorial… You’ve managed to turn something (creating a bespoke WP template) which seemed at first beyond me - even with a fair knowledge of html and a rudimentary knowledge of scripting languages. Put simply you’ve done something I love - demystify a technique which is actually simple but is shielded in unnecessary hoo ha!
My redesigned site is now uploaded but not entirely complete - need to redesign the front page, redesign the images and sort my CSS out (http://www.barelyhifi.co.uk).
Thanks again
Andrew
@andrew:
Thanks
Hey great tutorial. i have been searching around for a how to on how to build a custom template. I have great experience with HTML but new to the CSS and PHP thing
I have the template uploaded and it is pretty simple to understand, but how do I customize the look of the page? such as header, body, background? thanks for the help!
Mike
You can customize the look using CSS and other HTML related formatting tags. There are lots of CSS tutes available on the internet. Go for them.
how about adding image to the theme?
the theme look empty..there is no image!
can u create another tutorial on how to put the image to the theme such as header image,footer image,sidebar image and footer image..
check it out this web site http://kyohakeem.siotz.org can u teach me how to create theme like that?it owesome
@khairilz:
You can put images using the “img” tag. Go to http://www.w3schools.com to learn more about html and css.
Great tutorial. Thanks! But one question: in item # 4 you say “If you notice, there are special lines such as “”, “”, “”. “… well, actually I don’t see those at all, but then again I’m not sure what I’m looking for. Do you mean this literally, like we should be looking for two quotation marks together, or are you saying we should be looking for blank lines? This is confusing to me, as is the idea of how the index file “glues” everything together.
@Scott:
Oops! it seems wordpress has truncated some tags in the blog post. I hope you are able to download the sample.
The special lines are “get_header()”, “get_footer()” and “get_sidebar().”
so simple..
hi,
U become RICH.This is very Good site For Winning the project of all type.
if i could rearrange the alphebet i would put u and i toghther
love u forever blake please lets stick togther
I’ve been looking for a tutorial like this for some time. i appreciate you taking the time to write it!
THANK YOU SOOOO MUCH! I have been on WordPress support for 2 days trying to get such simple answers. The answer I got was if I did not understand their instructions I should not be using WordPress. Thanks for helping!!
JC
@James:
You can actually set up Photoshop (I run CS2 on my comp) to produce divs rather than tables.
http://www.daniweb.com/blogs/entry688.html
It positions the divs in ‘absolute’ but it shouldn’t be so hard to alter that.
Hope this helped
Nice tutorial, I have noticed the photoshop in creating wordpress themes.. But I don’t know how, maybe I could learn it in the future..
Any ideas how to do it, please email me some links, resources about it: my email admin[at]nolimirador[dot]com.
Thanx..
Hello, how are you ?
I realy love your tutorial! I am developing a Webdesign linux version and i want to put lot of wordpress content in it and I would like to put a portuguese translated version of your tutorial in my job, of course with your permission and credits. My project is also a final project for a pos graduation in free software.
thanks
Humberto
Humberto, please go ahead. Thanks for offering to translating it into Protuguese. Once done, please paste the link of the Portuguese version here.
wow. thanks a lot. i’ve been reading about other tutorials today and i kind of fell asleep on the middle part of their tutorials. Good job! You made it look easy.
Thank you so much for this tutorial. ♥
Nice, really explain the basic stuff in a pedagogic way. !
ONLINE - DRUGSTORE!
PRICES of ALL MEDICINES!
FIND THAT NECESSARY…
VIAGRA, CIALIS, PHENTERMINE, SOMA… and other pills!
Welcome please: pills-prices.blogspot.com
NEW INFORMATION ABOUT PAYDAY LOANS!
Welcome please: payday-d-loans.blogspot.com
GOOD LUCK!
Nice tutorial, definitely something to explore further.
What would make it even better? Make a short tutorial video and post it here.. embed it as a flash in the site (use Camtasia or something similar to quickly creat the video, http://www.camtasia.com)
Thanks again!
Palaestra Training
http://www.palaestratraining.com
Great tutorial , thank you !!
Nice Tutorial ! But header,footer.php or other how to customize them with older themes or any new ready them ? Can u explain that ? Please. . . . Any Way thanx for nice tut.
WHAT?
Oh, and did not know about it. Thanks for the information …
I have been looking for a tutorial like this and i am feeling glad to say that you really impressed me. Thanks to save my time and give me a quick learning.
Thanks!
very interesting.
i’m adding in RSS Reader
I have followed all steps and I think this tutorial is a good start, but still it’s only a start..
my question is, how can I use your tutorial and still have an automatic sidebar (wordpress script manageable) - and to make matters worse, with two columns ??
Thanks so much!!!! I’ve been looking for a tutorial like this for a long time!
I’m having trouble and hopefully you can help? How come when I insert an image in place of the tags you have in the header.php and footer.php files, the images don’t show? I only get the alt text!
um hi, HOW DO U PUT IT ON THE INTERNET!?!?!??!?!??!?!???!?!??!?!??
HOW DO U PUT IT ON THE WEB!?!?!?
I tried to download your files, I download them then use stuffit expander to uncompress the files and I get the message.” The file “DarlingTemplate.zip” does not appear to be compressed or encoded. It is advised that you obtain further information about the contents of this file from the sender or provider of the file.
THANK YOU VERY MUCH FOR EVERYTHING
@Canon:
Try to unzip the file using winzip or winrar. Unzipping the archive works properly for me.
Get Free professional Templates.
Nice tutorial
How can i add another bar at bottom page that the widget can detect as bottom_bar?
I know this post is is more than a year old, but it has helped me out alot.
I have always a bit intimidated with wordpress themes since I didn’t have knowledge of php. This helps me see that it’s nothing more than simple css manipulation.
I already have a whole theme based on the skeleton of the files provided.
Thanks - I’m definately linking to you to tell others how they can learn how to start making their own themes.
Thank you for the great tutorial. Never thought it would be that simple. You manage to remove the unnecessary part (the images, alignment, bla..bla..). Anyway, actually I Googled for “wordpress template without footer” but ur blog came out. I must be so lucky to find this!
P/S: Your SEO must be power… :p
Sorry for double posting. After I read ur tutorial then I try it out. I face a problem.
You said,
“If you notice, there are special lines such as “”, “”, “”.”
Which one are you referring to? The one that you asked us to copy from header.php?
Coisox, wordpress has removed a lot of content from the text boxes. Please download the attachment and try.
very interesting post, thank you very much
Thanks for this!
awesome! I will be trying this out tomorrow
thanks for the good info..
Sounds like this is a GREAT tutorial.
But after reading it all through…I still think it would be more pleasurable cutting off my own arm with a blunt penknife than trying to create my own website!
I’ll have to stick with paying people who actually enjoy this kind of torture to do it for me!
Thanks though!
Mike
Hi all great information here and good thread to comment on.
I am an adict to training and really want to get to my best this year!
Can I ask though - how did you get this picked up and into google news?
Very impressive that this blog is syndicated through Google and is it something that is just up to Google or you actively created?
Obviously this is a popular blog with great data so well done on your seo success..
Is there any reason in particular why my images wouldn’t show up on the website? I can’t get them to display, and they’re essential to my layout.
Didn’t work for me! I don’t know what I have done wrong.
When someone make learning a Fun Process, its very easy to understand . This tutorial on the WordPress Blog is example of that.
Regards
VIpin
interesting post
Thanks. You make this easier for me.I am really having a hardtime making blogs at wordpress.
Nice tutorial. I’d like to try that one.
really very interesting information
fantastic post, thanks a lot
great post
wow
Hi,
You did a great job writing down here a lot of good information.
I’m not an expert in php and your advices really help.
Now, I want to change my default wp theme (on my new blog) in just one way: I want every post from index and achieve pages to has (read more) by default. Let’s say, they will can read only the first paragraph, or first 50 characters or something like this… not entire post in index.
I really don’t like when the people can read with just one click on my home page, all (10) latest posts.
Can you help me with this?
I really appreciate!
Ken.
Very cool post, it’s been on my list to sort out the themes of a couple of my blogs as they’ve been integrated into main sites but haven’t had the energy to decipher the existing themes.
This is an excellent post and I pretty much had it all sorted in an hour!
Thanks!