Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Child themes

jayj edited this page · 9 revisions

Since Cakifo is a parent theme, you'll want to create a child theme if you plan on making any customizations. What way you won't lose your changes when Cakifo is updated. Don't know how to make a child theme? It's relatively simple. Just follow the below steps.

I've added an example child theme in the download as well.

  • Create a theme folder in your wp-content/themes directory called cakifo-child (or something else - you decide)

  • Then, create a style.css file within your theme folder

  • At the top of your style.css file, add the below information

/**
 * Theme Name: Cakifo child
 * Theme URI: http://link-to-your-site.com
 * Description: Describe what your theme should be like.
 * Version: 1.0
 * Author: Your Name
 * Author URI: http://link-to-your-site.com
 * Tags: Add, Whatever, Tags, You, Want
 * Template: cakifo
 */

This will give you a blank design. If you want to import the Cakifo parent theme style, simply append this code after the above information:

@import url( '../cakifo/style.css' );

/* Custom code goes below here. */

See more about Child Themes at the Codex

Functions.php

You can make more than just style changes in a child theme. Unlike style.css, the functions.php of a child theme does not override its counterpart from the parent. Instead, it is loaded in addition to the parent's functions.php. (Specifically, it is loaded right before the parent's file.)

Adding functions or changing things in the parent theme will be lost when it's updated. Fortunately Cakifo is very user child theme friendly. It has a lot of hooks and filter to make it easy for you to change the functionality of the parent theme in your child theme. See the Hybrid Core Hooks guide for more information.

Example

An example child theme is included in the download. But I'll give an example here as well

Let's say you want to change the speed of the slider. That's very easy. In your child theme functions.php do this

function my_slider_args( $args ) {
    $args['slideSpeed'] = 500; // Speed of the sliding animation in milliseconds
    $args['play'] = false; // Disables auto start

    return $args;
}

add_filter( 'cakifo_slider_args', 'my_slider_args' );

Or you want to remove comments from pages. Easy

add_filter( 'show_singular_comments', '__return_false' );

There's an example functions.php in the example child theme.

Something went wrong with that request. Please try again.