Friday, January 15, 2010

Introducing Wordpress Theme

In the post Wordpress Admin Panel I have introduced about wordpress admin panel. In this post I will discuss about wordpress theme. Wordpress theme is a collection of files that work together to produce the graphical interface with an underlying design for the website.

Wordpress theme uses combination of three things.
A)Template Files.
B)Template Tags.
C)CSS Style Sheets.

A)Template Files: Template files are the files (building blocks) which come together to create the site. The header, sidebar, content, footer are all individual template files.

The following are the template files typically included within a Theme.

i) 404 Template = 404.php
ii) Archive Template = archive.php
iii) Archive Index Page = archives.php
iv) Comments Template = comments.php
v) Footer Template = footer.php
vi) Header Template = header.php
vii) Links = links.php
viii) Main Template = index.php
ix) Page Template = page.php
x) Popup Comments Template = comments-popup.php
xi) Post Template = single.php
x) Search Form = searchform.php
xi) Search Template = search.php
xii) Sidebar Template = sidebar.php

B) Template Tags: Template Tags are small piece of code which provide instructions and requests for information stored within the WordPress database. It instructs WordPress to "do" or "get" something. For example after login to wordpress Dashboard if you open template file header.php ( from Appearance>Editor) you will notice template tags like below.

<?php language_attributes(); ?>
<?php bloginfo('html_type'); ?>
<?php bloginfo('charset'); ?>
<?php bloginfo('name'); ?>
<?php bloginfo('stylesheet_url'); ?>
<?php bloginfo('pingback_url'); ?>
<?php wp_get_archives('type=monthly&format=link'); ?>
<?php //comments_popup_script(); // off by default ?>
<?php wp_head(); ?>
<?php bloginfo('url'); ?>

Each of these template tags instructs wordpress to "do" or "get" something. Let's introduced with bloginfo temaplte tag with some parameters that it take.
1)Site Name <?php bloginfo('name'); ?> : The bloginfo template tag with name parameter is used to display the site name that is set by admin via Settings> General subpanel.

2)Site Description <?php bloginfo('description'); ?> : The bloginfo template tag with description parameter displays some descriptive sentence that says the blog/site about. Generally it is called tagline. This is set by admin via Settings> General subpanel.

3)Site url <?php bloginfo('url'); ?> : The bloginfo template tag with url parameter is used to display the URL or website address for your WordPress site. This is set by admin via Settings> General subpanel.

4) Admin Email <?php bloginfo('admin_email'); ?> : bloginfo template tag with admin_email parameter is used to display email of the administrator.

5) Wordpress Version : The bloginfo template tag with version parameter display the version of WordPress you are using.

C)CSS Style Sheets: CSS Style Sheets make the things all together. With your css you can move the building block structures around, make your header very long, float the sidebar left or right. The css stylesheet instruction are found under style.css file.

No comments:

Post a Comment