Created
October 13, 2017 08:36
-
-
Save Rakeshbagri/65dbcd3a4f1b706bdd7b0894285cc140 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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' ); | |
} | |
?> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create child theme folder | |
Step 1: Create a folder and name it anything you like. Ex: optimizer-child | |
Step 2: Create a file titled style.css | |
Step 3: Open the style.css and write below information | |
/* | |
Theme Name: Optimizer Child | |
Template: optimizer | |
*/ | |
Step 4: Create a file titled functions.php and paste below code to import the parent themes style. | |
<?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' ); | |
} | |
?> | |
Step 5: Now Zip the folder and upload it via Appearance -> Themes -> Add New | |
Step 6: Activate the theme. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Theme Name: Optimizer Child | |
Template: optimizer | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment