You can choose any default theme to adapt the look of your website to fit your vision. Many of WordPress developer don't know what to implement next, however a problem arises.

Customizing a WordPress theme, you might be doing it wrong

That means when you try to edit their themes directly, or changing and adding files in their current theme's folder. This will create a number of problems. The issue is mainly with updates. If you make changes to a theme's files, it will be lost or overwritten once the theme is updated by developer. As a consequence, users won't be able to keep their theme up to date.

A child theme allows you to make any number of changes by setting up a standalone directory without touching any of the original theme files.

In this article we will learn what WordPress child themes are, how to create and use them to customize your website.

What Are Child Themes and Why Use Them?

A WordPress child theme inherits all the features and appearance of its parent theme. You can customize it without affecting the parent theme. It changes only those parts that you want to be different. You can alter styles, layout, functions, templates and more.

WHEN TO USE A CHILD THEME

If you want to make only minor modifications, such as color or font then a custom website design CSS plugin would fit to your needs. But if you want to introduce large changes then a child theme might be all you need.

Set Up a Basic Child Theme

Let's start with WordPress Default theme - twentyfifteen

A child theme needs three things: its own folder, a style sheet and afunctions.php file

.Create a folder in WP-content/themes with the same name as the parent theme and append it with -child.

CREATE A STYLE SHEET

/*Theme Name: Twenty Fifteen ChildTheme URI: http://example.com/twenty-fifteen-child/Description: Twenty Fifteen Child ThemeAuthor: John DoeAuthor URI: http://example.comTemplate: twentyfifteenVersion: 1.0.0License: GNU General Public License v2 or laterLicense URI: http://www.gnu.org/licenses/gpl-2.0.htmlTags: light, dark, two-columns, right-sidebar, responsive-layout, accessibility-readyText Domain: twenty-fifteen-child*/

My child theme's header

/* Theme Name: Twenty Fifteen Child Theme Description: A child theme of the Twenty Fifteen default WordPress theme Author: Nick Schäferhoff Template: twentyfifteen Version: 1.0.0*/

ACTIVATE CHILD THEME

Now go to "Appearance" → "Themes", find your child theme there and click "Activate"

INHERIT PARENT STYLES

@import url("../twentyfifteen/style.css");

As you have seen above creating a child theme is not a very complicated task, hopefully this article will help you to customize a Wordpress website completely and safely without editing any parent files.

 

 

 

Source : articlesbase.com

0 comments:

Post a Comment

 
Rewrite Article © 2016.Someright Reserved.
Top