Sunday 19 June 2016

How to Create a Child Theme of WordPress?

There are 2 Good Plugin available for Create Child Theme.
1. One-Click Child Theme
2. Child Theme Configurator


You Can Manually create Child Theme as Follow:

There are 4 files in child Theme.
1. functions.php
2. rtl.css
3. screenshot.png ( This is Child Theme Image )
4. style.css


1> Create "functions.php" & Put Following code in it:

<?php
//
// Recommended way to include parent theme styles.
//  (Please see http://codex.wordpress.org/Child_Themes#How_to_Create_a_Child_Theme)
//
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style',
        get_stylesheet_directory_uri() . '/style.css',
        array('parent-style')
    );
}
//
// Your code goes below
//

2> Create "rtl.css" & Put Following code in it:

/*
Theme Name:     Child Theme Name
Template:    

Right to Left text support.
*/

@import url("../Parent Theme Directory name/rtl.css");


3> Image for Child Theme Rename your Image to "screenshot.png".
      Image minimum Size must be 880*660 px.


4> Create "style.css" & Put Following code in it:

/*
Theme Name:     Child Theme Name
Description:    Child Theme Description put here.
Author:         Author name
Template:       Parent Theme Directory Name

(optional values you can add: Theme URI, Author URI, Version, License, License URI, Tags, Text Domain)
*/


Put all file in Single folder. Your Child Theme is ready.

Put in WordPress Theme directory & Activate it from WordPress Admin Panel.


For more Interesting, Useful Article & codes visit IT New Code.

Ankit Shah PHP Expert

IT New Code suggest a solution for your problem related to coding, Specially .PHP, Wordpress, WooCommerce, Magento, HTML and CSS. Visit Our website for Information.

0 comments:

Post a Comment

 

Copyright @ 2016 IT New Code | Developing Code | Designing Code.

Designed by: Ankit Shah