Tek Eye Logo

Tek Eye

Quickly Create a WordPress Child Theme

WordPress is a free software package to make it easy for people to manage their own websites. It allows for easy blogging and content management and can be regarded as a full blown Content Management System (CMS). Most web hosting companies provide simple WordPress installation for domains and web hosting purchased through them. Plus there is the dedicated WordPress site for blogging at WordPress.com.

WordPress Logo

The look of a site using WordPress is controlled by the current theme it is configured to use. By switching to a new theme a new look for a website can be achieved without altering the site content.

WordPress Themes Example

WordPress comes with several default themes, named after the release year. There are default themes named Twenty Thirteen, Twenty Fourteen and Twenty Fifteen. Earlier ones can be added for free. There are thousands of paid for commercial "premium" themes and free community or open source themes.

WordPress Themes

Child Theme Quick Start with a New Folder and Files

A theme can be changed to fine tune it to your own requirements. The best way to do this is to create a child theme that references the theme you want to change. Make any required changes in this child theme and keep the original theme untouched. This prevents customisations from being lost when WordPress or original themes are updated. This article covers the basics of getting a child theme ready, which simply involves creating a new folder in the WordPress installation and adding two new files. A file called style.css, a Cascading Style Sheet (CSS) file, and a file called functions.php, a code file.

Once the child theme is generated select it from the Themes option under Appearance when logged into WordPress. When the original theme is updated when a new release comes out, the changes made to the child theme are not overwritten.

Create a Blank Child Theme to Allow For Theme Modification

Each theme is in its own folder in the WordPress installation. WordPress will be installed in the website's root folder, or a folder off the root. Most web hosting providers provide a control panel with a file manager to view the website folders and files. There will be a wp-content folder and inside that a themes folder. In the themes folder there is a folder for each installed theme. Thus there is a wp-content/themes/twentythirteen folder for the Twenty Thirteen theme, a wp-content/themes/twentyfourteen folder for the Twenty Fourteen theme and so on.

Quickly Create a WordPress Child Theme Starting Point

Make a WordPress child theme by adding new files to a new folder in themes and editing the new files. The new files will reference the original theme. Most hosting companies provide on line tools to allow files and folders to be changed on your website.

(Alternatively create the new folder and files off line and use FTP to upload the folder and files to the themes folder. Hosting company's usually provide on line FTP tools, or use a program such as FileZilla. Your hosting company will provide you with the FTP log in details if needed.)

Create a new folder in themes and give it a name (e.g. myowntheme). In the new folder create a file called style.css. Add the following text to the file, changing the values for Theme Name and URI, Author Name and URI and the description as required:

/*
Theme Name: My Own Theme  
Theme URI: http://your-themes-homepage.com  
Description: Child theme for the Twenty Sixteen theme  
Author: Your Name  
Author URI: http://www.your-website.com  
Template: twentysixteen
Version: 0.1.0  

Descriptive Text  

*/ 

/* Ready for custom styles. */ 

That's the starting point done. Here the theme is based on the default Twenty Sixteen theme. You will enter the name of your chosen theme for the basis of the child theme. Next create the functions.php file in the myowntheme folder (or whatever folder was created). Add this code (note the function can have a custom name but must match the second name parameter in the add_action call):

<?php
function mytheme_enqueue() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'mytheme_enqueue' );

The theme will now show up on the Themes page under Appearance in the admin screens. Modifications to the theme will be made by adding files and code to the new theme.

WordPress Child Theme

Any files that appear in the child themes folder can be changed in the WordPress Editor.

Edit WordPress Child Theme

See Also

Child Themes at WordPress.org

Author:  Published:  Updated:  

ShareSubmit to TwitterSubmit to FacebookSubmit to LinkedInSubmit to redditPrint Page

Do you have a question or comment about this article?

(Alternatively, use the email address at the bottom of the web page.)

 This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

markdown CMS Small Logo Icon ↓markdown↓ CMS is fast and simple. Build websites quickly and publish easily. For beginner to expert.


Articles on:

Android Programming and Android Practice Projects, HTML, VPS, Computing, IT, Computer History, ↓markdown↓ CMS, C# Programming, Using Windows for Programming


Free Android Projects and Samples:

Android Examples, Android List Examples, Android UI Examples



Tek Eye Published Projects