[http://ithemes.com/forum/index.php?/topic/8795-how-does-one-change-color-of-the-universal-black-of-nav-bar-widget-headers/ How does one change color of the universal black of nav bar & widget headers?]

+

+

[http://ithemes.com/forum/index.php?/topic/8036-how-to-change-site-navigation-colours-in-flex-elegant/ How to change site navigation colours in flex elegant]

+

[[Flexx|Back to the main Flexx page]]

[[Flexx|Back to the main Flexx page]]

[[Category:Themes]]

[[Category:Themes]]

[[Category:Flexx]]

[[Category:Flexx]]

Revision as of 06:10, December 4, 2010

Check the General FAQ page in case your question does not appear in this section.

How to create a Child theme for Flexx

In order to preserve your original Flexx theme files (as downloaded), you should use a Child Theme. Using Child themes, you can modify (override) all aspects of an existing iThemes (Parent theme), e.g. the css code in the stylesheet, html or php code in the page templates, functions, without having to modify any of the original core theme template files. This also means that upgrading the parent theme does not overwrite any of your modifications.

This article describes how to create a Child theme for Flexx CandyApple theme, but it applies to all Flexx themes.

There is one modification required to the parent theme.

Minimum requirements

Your current Flexx theme should be at least at version 2.6.3 (release date: Oct. 15, 2009)

Modifications in the Parent themes functions.php

Locate the following code in functions.php of the parent theme. Note that currently, this modification will be overwritten when you upgrade the theme.

//A function to include files throughout the theme
//It checks to see if the file exists first, so as to avoid error messages.
function get_template_file($filename) {
if (file_exists(TEMPLATEPATH."/$filename"))
include(TEMPLATEPATH."/$filename");
}

and replace that entire block of code with:

//A function to include files throughout the theme
//It checks to see if the file exists first, so as to avoid error messages.
function get_template_file($filename) {
if (file_exists(get_stylesheet_directory()."/$filename"))
include(get_stylesheet_directory()."/$filename");
else if (file_exists(get_template_directory()."/$filename"))
include(get_template_directory()."/$filename");
}

This will make sure that theme functions will try to locate a theme file in the Child theme template first, and if it does not exists, the theme will use the file from the parent theme.

Creating a child theme

A child theme in the most essential form contains only a stylesheet, named style.css. Code in that stylesheet will tell WordPress that this is actually a Child theme, and what its Parent theme is.

To make sure all functions work properly, and all images used for the design of the theme, we will need to duplicate the following files and folders.

copy the images subfolder and all it's content to the Child theme folder

copy the screenshot.jpg to the Child theme, it will just look better on the WordPress themes panel (optional)

create a style.css, and make sure it has the proper information in the header.

Download a sample Child theme

Using the Child theme

Install the Child theme as you normally would, using the WordPress theme installer, or by unzipping and uploading the Child Theme folder to your wp-content/themes folder. Activate the Child theme just as you would activate any other theme.

How to change the navigation bar colours

The navigation bar in Flexx themes is generally made up from background colours, and background images. All the styling is done using CSS, you will find the relevant section labeled: