What Are WordPress Themes?
Sometimes the most obvious questions are overlooked - like what are WordPress themes?
For those of us working with WordPress constantly, it’s old hat - but for people setting up a new blog, the concept is not simple.
In fact, the WordPress theme system is unlike anything I’ve worked with before, an unusual pastiche of files and code that combine into a web page.
Let’s say your blog has the default theme active (as set in the Presentation menu of your WordPress Admin). Even though you physically load a page at (for example):
http://egwebsite.com/index.php
You would actually be loading the following files to make up that page:
http://egwebsite.com/wp-content/themes/default/index.php
http://egwebsite.com/wp-content/themes/default/header.php
http://egwebsite.com/wp-content/themes/default/sidebar.php
http://egwebsite.com/wp-content/themes/default/footer.php
However, you’d never load them directly, but the topmost index.php takes care of it - in fact, it ultimately takes care of every WordPress page display, with the exception of the Admin section.
Of these files, only that index.php file needs to be present - it in turn loads the other files. On older WordPress templates (another term for WP themes), there was just one large index.php file, which took care of all the page variations in one place.
This is where confusion can exist - the WordPress site ROOT has an index.php file, but the THEME also has one - and you never edit the root one, or your site can lock up! (I once had an irate email because a fellow made the wrong edits).
And of course, there are multiple themes - for example, new WordPress installations include both default and classic themes, each in their own directory:
http://egwebsite.com/wp-content/themes/default/index.php
http://egwebsite.com/wp-content/themes/classic/index.php
So even though there is a classic theme as well as default, only the selected theme is used.
There are also optional pages that can influence WordPress - for instance. if you are viewing an individual post, WordPress will look at your current theme directory, and use a file called single.php if it can find it, or index.php if it cannot.
Fortunately, all this is not absolutely necessary to work with themes, and the least you need to know is: Themes reside in the /wp-content/themes/ directory, each in a directory of its own, and you pick them via the Presentation tab.
And even though you never call them directly, they are some of the most important files you will ‘call’ in your blog - providing the full look of your site!
| ActiveBlogging.com - for information on making your blog successful! Get information like this - and more - inside! Details here or Join Today! |



May 8th, 2008 at 9:30 pm
I once found a great theme that had no singe.php Couldn’t get anyone to explain to me why.
May 9th, 2008 at 9:02 am
Really old themes (for the version 1 of WordPress) used to have a single index.php file, so possibly you’ve found an oldie. It will work, but the pages will all display more or less the same.
If a theme doesn’t include single.php, WordPress will create it using the code in the index.php file - so it’s not required. It’s usually included so you can come up with a different look for that section.