Sunday, April 22, 2012

Wordpress :: different files of a theme folder and their uses

Template system is a great feature which is associated with wordpress. Users may have their multiple themes stored inside 'wordpress/wp-content/themes/' folder so that they can select and activate one of them at a time.
Wordpress package comes up with two in-built themes ( twentyten & twentyeleven). Beside these two theme folders if users need more then they may download free themes from websites like simplewpthemes.com, freewpthemes.net etc and upload those themes to this path 'wordpress/wp-content/themes/'. As soon as they will activate one of these folders through admin panel they will get a new look & feel for their website. However users with having bit knowledge in html/css may also build their custom theme. PHP knowledge will be an added advantage in this regard.

Before building their custom theme they should know about the different files of one of the in-built theme folders (twentyten or twentyelven) and their uses. Those files consists of both html and php codes where php codes are responsible for functionalities, html codes are responsible for providing the required format. Below are the list of some files with their uses in wordpress:

header.php : This file contains the content of header section of the web pages. It is included into page.php, index.php etc. Generally the link to css file, javascript file(s) are added in this file. In most cases top menu bar, website logo, home page banner etc are defined in this file.
footer.php : This file contains the content of footer section of the web pages. Generally copy right information and footer links are defined in this file.
sidebar.php : Optionally this file is used when there is a need to display content in either left sidebar or right sidebar of the web pages. Generally left menu or right menu is defined in this file.
index.php : This file is responsible for showing posts which are created by admin through backend. So in wordpress blog is generated though this file.
page.php : This file is responsible for showing the content of pages which are created by admin through backend. It is also a template file as it provides a ceratin look and feel to the pages which are created by admin dynamically.
single.php : This file is responsible for showing individual post on a separate page apart from blog page.
category.php : This page shows all the posts of a particualar category.
404.php : This file shows the error message when a page is not found which is searched by a website visitor. Users can modify the content of this file to show their custom messages to the website visitors.
search.php : This file shows the link of posts and pages as search result when website visitors use different keywords in the searchbox to get their desired result.
comments.php : This file is responsible for showing different comments made by website visitors on different posts along with the comment form which let visitors to post their comments.
archive.php : This file is responsible to show all the posts on the basis of created years and months.

No comments: