Created
January 6, 2017 09:12
-
-
Save 2shrestha22/822eb75b918d3452faf79ef6dc7a88b0 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* An example of enqueuing a child theme.... xyz=your parent theme direcrtory name, you can find it in wp-content/themes/ directory. */ | |
//*********************** | |
function enqueue_my_styles() { | |
$parent_style = 'xyz-style'; | |
// Gives value of variable xyz | |
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' ); | |
// To enqueue parent theme css | |
wp_enqueue_style( 'xyz-child-style', | |
get_stylesheet_directory_uri() . '/style.css', | |
array( $parent_style ) | |
); | |
// To enqueue child theme css | |
/* If your theme has stylesheets other than style.css you should enqueue them also, /css folder may also contain rtl.css, editor-style.css and ie.cs, they will be loaded automatically if needed so we don't need to enqueue them.*/ | |
} | |
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment