Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Child themes

jayj edited this page · 1 revision

Japibas is relatively child theme friendly. So if you plan on making any customizations you should use a child theme. That way you won't lose your changes when Japibas 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 japibas-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: Japibas 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: japibas
 */

If you want to import the Japibas style, simply append this code after the above information:

@import url( '../japibas/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 Japibas. Instead, it is loaded in addition to the Japibas' functions.php. (Specifically, it is loaded right before the functions.php from Japibas.)

Adding functions or changing things in the Japibas theme will be lost when it's updated. Fortunately Japibas is relatively child theme friendly. It has some hooks and filters to make it easy for you to change the functionality in your child theme.

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 add some more layout options in the Theme Options. That's very easy. In your child theme functions.php do this

function my_japibas_child_layout_options( $layouts ) {

    // Add an option to have a left and a right sidebar (you need to add CSS styling for it to work on the frontend)
    $layouts['sidebar-left-right'] = array(
        'value' => 'sidebar-left-right',
    'label' => __( '3-columns, content center', 'japibas' ),
    'thumbnail' => get_stylesheet_directory_uri() . '/images/sidebar-left-right.png' // Images folder in the child theme
    );

    return $layout;
}

add_filter( 'japibas_layout_options', 'my_japibas_child_layout_options' );

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

Something went wrong with that request. Please try again.