Add existing class to #page element easily using template.php
In this example we add an existing class to the #page element using template.php
The first thing to do is to open up the file named template.php with your preferred editor. This is located within your theme folder, usually found at: sites/all/themes/*yourtheme*/
If you are using an omega based theme it will look something like this:
/**
* @file
* This file is empty by default because the base theme chain (Alpha & Omega) provides
* all the basic functionality. However, in case you wish to customize the output that Drupal
* generates through Alpha & Omega this file is a good place to do so.
*
* Alpha comes with a neat solution for keeping this file as clean as possible while the code
* for your subtheme grows. Please read the README.txt in the /preprocess and /process subfolders
* for more information on this topic.
*/
Now add the following function underneath the comments shown above:
function THEME_preprocess_page(&$vars, $hook) {
//adds existing class to #page element
$vars['attributes_array']['class'][]='newClass';
} Where THEME_ is your theme name, and 'newClass' is the class you wish to add to the #page element.
Read moreHiding active language from language switcher block
The language switcher block does not support the ability to hide the active language, therefore this has to be done in template.php
This will also disable any active language links that use the theme_links
Overview of theme files
A theme is a collection of files that define the presentation layer. You can also create one or more "sub-themes" or variations on a theme. Only the .info file is required, but most themes and sub-themes will use other files as well. The following diagram illustrates the files that are found in a typical theme and sub-theme.
Drupal 6

Drupal 7

- .info (required)
-
All that is required for Drupal to see your theme is a ".info" file. Should the theme require them, meta data, style sheets, JavaScripts, block regions and more can be defined here. Everything else is optional.
The internal name of the theme is also derived from this file. For example, if it is named "drop.info", then Drupal will see the name of the theme as "drop". Drupal 5 and below used the name of the enclosing folder of the theme.
Info files for themes are new in Drupal 6. In version 5, .info files were used solely for modules.