webmaster tutorials and internet facts

Wordpress template from scratch tutorial #1

wordpressWe will start our wordpress template design from wordpress template files structure. I’m sure you installed your wordpress and have access to wp-admin, so login your wp-admin and click on “appearance”, click on editor, you will see wordpress template files structure. In this tutorial we will explain who is who in our wordpress template.

404 Template ( 404.php )

404.php file is a wordpress default error page, it’s so called “nothing found” page, if someone types mess in his browser or reaches the post you’ve just deleted , he will see this page.

Archives ( archive.php )

archive.php file customizes taxonomy database fetching of wordpress blog. It reads database by tags, dates or categories.

Archives Page Template ( archives.php )
archives.php calls and prints shortened posts archives by category
Attachment Template (attachment.php)
This template is for attachements, image for example, once somewone clicks on image in our blog, he will reach attachement page.
Comments (comments.php)
Comments.php is a blog’s comments object element. Once someone posted comment, it stored in mysql database, comments.php rules the output of the posted comments.
Header (header.php)
Header is a top section of our blog, it defines html meta configurations, such as keywords, description, blog title, header is a good place for website name output or logo, it is a best place for main menu also.

Footer (footer.php)
Footer it’s a bottom part of our website, footer usually closes html and body tags and footer closes every blog’s page, copyright text could be located here.

Links Page Template (links.php)
Well, links.php used to output links page defined from wp-admin
Main Index Template (index.php)
This file is for our blog’s home page design and definition, we could design really cool home page, all html and wp-core php code will be written here as a first visitors impression of our blog. It is a most important file to be designed for our template.
Page Template (page.php)
page.php used to read our pages from wordpress database, all definitions and commands insede are used for blog’s page design.
Page with Comments Page Template (page-comment.php)
This is a same as page.php, but here we will add some comments blocks because page-comment.php is a page with comments.

Search Form (searchform.php)
searchform.php used for design of blog’s search form
Search Results (search.php)
search.php used for design of blog’s search results
Sidebar ( sidebar.php )

Sidebar.php is a side html object, we could add there anything we want, usually it’s used for “last pages” output, calendar and tags, it located on right or left of our blog

Single Post (single.php)
single.php is a design of our single post page, onece someone clicks on blog’s archive link, he will see single blog’s post.
Theme Functions (functions.php)
This file used to declare additional template design functions, we don’t need to design this page, only if we want to add some particular tags of output inside of function itself.
Every wordpress template directory could contain any custom coded or defined classes or functions files, you can simply call them in every page with PHP “include” or “require” functions.
So, when we know what actually we are going to modify we can start developing our wordpress template.

Add Twitter response to this post...
Twitter username :   
Twitter password :

Post Metadata

Date
June 30th, 2009

Author
glurt

Tags


1 Trackbacks & Pingbacks

  1. July 5, 2009 11:30 am

    Wordpress template from scratch tutorial #2 | glurt :

2 Comments

  1. Thanks guys, good info.



Leave a Reply