Create Child Theme Of Flat Theme

April 29, 2015 - wordpress

Hi there!

You can read about child themes at the WordPress Codex here.

You don’t necessarily have to copy any files, it depends on what you are trying to achieve. For basic CSS customizations you don’t need to copy any thing, just create two new ones:

1. style.css

Paste in this code (modify as necessary):

/* Theme Name: Flat Theme URI: Description: Flat Child Theme Author: John Doe Author URI: Template: flat Version: 1.0.0 Tags: flat Text Domain: flat-child */ /* =Theme customization starts here -------------------------------------------------------------- */

2. functions.php

Paste in this code:

<?php add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX); function enqueue_child_theme_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' ); wp_enqueue_style( 'child-style', get_stylesheet_uri(), array('parent-style') ); } ?>

Then go to Appearance -> Themes and activate your new child theme. You can paste any CSS into your style.css file.

Leave a Reply