Skip to content

Instantly share code, notes, and snippets.

@pehaa
Created August 11, 2019 11:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pehaa/9317958c938ef47e2815b1bbdae16b35 to your computer and use it in GitHub Desktop.
Save pehaa/9317958c938ef47e2815b1bbdae16b35 to your computer and use it in GitHub Desktop.
Child theme functions.php
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
$parent_style = 'parent-style';
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 ),
wp_get_theme()->get('Version')
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment