WordPress Themes

Child Themes

A WordPress child theme is a theme that inherits the functionality of another theme, called the parent theme, and allows you to modify, or add to, the functionality of that parent theme. This article shows how to create a basic child theme and explains what you can do with it. As an example parent theme it uses Twenty Eleven, the new default theme in WordPress 3.0.

Making a child theme is very simple. Create a directory, put a properly formatted style.css file in it, and you have a child theme! With a little understanding of HTML and CSS, you can make that very basic child theme modify the styling and layout of a parent theme to any extent without editing the files of the parent theme itself. That way, when the parent theme is updated, your modifications are preserved.

For this reason, child themes are the recommended way of making modifications to a theme.

With a basic understanding of PHP, WordPress Templates, and the WordPress Plugin API, you can make the child theme extend virtually every aspect of a parent theme, and again, without actually changing the parent theme files.

Tutorial

Look here. And here.

Directory Structure

You can find your theme files on your webserver at /wp-content/themes/themeName/

Custom WordPress Theme Development

First off, WordPress is very much build around the assumption that you are making a blog and all that entails, such as posts that are tagged and catagorized, comments, pingbacks, blog rolls, filtering posts. The documentation and examples are built around this assumption. That said, you can force WordPress to act more like a traditional CMS.

Simple Theme Development for a Website (not a blog)

This is remarkable easy to do once if figure out what's important and what can be deleted.

Directory structure
  1. Create a new WordPress installation and then add the files shown here. You can download a copy of the files. By simply creating a new directory under "themes", and including the proper comments in your style.css file, you have just created a new theme.
  2. Now it's time to get busy tweaking it for your new site. The "oasis" theme makes the assumption (as do most WordPress themes) that the same header and footer will be on every page.
    1. footer.php: Edit the content as needed.
    2. header.php: Edit the content as needed. The menu items are dynamically built from the list of "pages" in your WordPress site.
    3. img: This folder contains all the images that are used by the style.css file. (Like background: url(myImage.jpg);)
    4. index.php: This is the content area of the page. Probably no need to edit this file.
    5. style.css: You will be spending the bulk of your time tweaking this file.
  3. In the WordPress Admin screen, create a page called "Home" and add your content. Go ahead and create your other pages now if you wish.
  4. In the WordPress Settings/Reading panel, create a "Home" page.
  5. You're done!

Summary