How Your Website Theme Works

The module that controls your website design and layout is called a Theme and this transforms both static HTML code and dynamic PHP from code blocks of text into stylish layouts. I’m not going to get technical about this because neither of us needs to know.

The WordPress CMS comes with a default theme you can use, or you can activate any other new theme. Many expert programmers have made available, both free and premium themes you can use to change the look and feel of your website. You could also hire a designer to create a personal theme for you.

What the theme does is to provide template pages for the various areas of your website. Within your theme directory you will find template files for your header and footer areas and for posts and pages. There is also a functions file and a style sheet.

The function file allows a theme designer to set specific widgetized areas in your sidebars and to enable any other useful functions they wish to use in the theme. These functions are “called” with the use of code written in the templates.

The style sheet provides the rules that govern how¬† content between specific HTML tags should be displayed. Examples are the “Header 1” tag, you can set this to use a specific font family, colour and size. Another example is “a bulleted list”, when the list is called, you can set a specific image, such as a tick to display, rather than the default circular dot.

Editing Page Templates

You can edit the template files for your theme under Appearance> Editor. You must be very careful not to delete any important code however, or your theme may “break”.

Before you even think of editing the Theme, make a backup, or download a new copy of the theme so you have a true copy available, just in case. Then if you do break the theme, you can either paste the original page over your altered one, or overwrite the whole theme using FTP to fix it again.

If your website is getting good traffic, theme editing is best done on a test site, that is a second installation of the WordPress CMS that is kept private. Here you can test out themes and plugins without potentially losing credibility if your website suddenly splits apart at the seams, instead of being neatly aligned. Then once you have made your changes and they are looking good, you can bring the change to your public website without much chance of disturbing your visitors.

When you do make a change to your theme, you need to make a backup of the edits or the whole theme and save it to your computer. At a future time, an update may occur and you will want to update your theme to keep it secure and enjoy any enhancements the theme author may have made. Theme updates will not include your specific changes, even if it was only one line in a function file. The update will simply overwrite your current theme and delete your changes along with it. So be careful updating and be sure to remember what you changed and where, so you can re-enter your changes on the updated theme.

Common Theme Edit Changes

Few users will want to make drastic changes but there are a few common changes that people feel obliged or have a need to make. In the footer file most themes, by default, give a link to the theme author and a copyright notice and link with the website title and url.

If your theme licence allows, the link to its author can be removed, usually by deleting it from the footer template. You can also add to or alter the date and website title in the copyright information. It may be in the footer file, the index file or the single post file.

Some plugins you will want to use may require you to add some code in your function file to enable their plugin to work with your theme or use their widget. Some provide code to add to your page templates, as well as using a widget, so you can use their function inside the post or page.

Other common changes are whether to display whole content or excerpts, and what text to use as a descriptor for the “read more” link, or the “leave a comment” instructions. You can make changes to templates to display lists by different criteria such as ascending or descending, by date, or id, or category .

You cannot harm your theme unless you SAVE your changes to it, click away without saving and no change is made. So feel free to go and look at the code and get a feel for how it’s doing it’s work.

It is also possible to add new page templates to the theme. For example you might want to use a template that doesn’t use any sidebars. By creating a new template that doesn’t call the sidebars, you can select this template on certain pages for displaying your content in a greatly different way.

Theme Engines

There are preconfigured themes and there are themes you can configure. A theme engine is a theme you can configure.

The Flex theme that I use and recommend is unlike single design themes. It adds a theme administration area under the Appearance menu. here you can edit both the theme and its CSS by entering information into a form and saving it. There isn’t a hint of code and its options are all clearly laid out with tooltips. The most complex thing you need to understand is pixel size.

There are options to change the width of your website and how many sidebars to use and how wide they are and where they will appear. There are options for the colours of links and fonts, for backgrounds and header graphics, for how many widgetized areas you want to use and whether you want these to be different colours or use different fonts.

Essentially this means that you can make this theme look extremely different for each website you create with it. If you look at my profile page, most of these websites are using this theme.

Premium themes and some theme engines, may include or need to use specific plugins. These may install automatically or you may need to install them yourself in the plugin folder using FTP. Make sure you read the installation instructions for this reason. This file will also tell you if your server is compatible as some script libraries, or PHP5, may need to be available or enabled to use the theme. Check with the server to see if you have these things or if they can be enabled before making a purchase.

Personally I prefer to keep my theme and my plugins separate in keeping with the modular nature of the CMS. You can get themes that are SEO’d or that have video or audio players with them, but I feel this may cause conflicts and confusion when people try to use other plugins. If they are locked into using one plugin with a theme, they may have to abandon use of another or change the theme. If you have paid for the theme this isn’t a pleasant choice to make.

Tagged with:

Filed under: 29 Steps29 Steps-2ThemeTutorials

Like this post? Tell someone about it! Share the link with social communities like Facebook by clicking on the orange SHARE icon above. look for the envelope icon to email the article to a friend. When you click MORE scroll down the list to PRINT or PDF to save the article for future reading.