Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Created October 4, 2021 16:52
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 atwellpub/ed634fb8ed35a32a4c14dc0c4dde9892 to your computer and use it in GitHub Desktop.
Save atwellpub/ed634fb8ed35a32a4c14dc0c4dde9892 to your computer and use it in GitHub Desktop.
Very simple child theme functions.php
<?php
class ChildTheme {
/**
*
*/
public function __construct() {
$this->load_hooks();
}
/**
* add action hooks and filters
*/
public function load_hooks() {
add_action( 'wp_enqueue_scripts', array( __CLASS__ , 'enqueue_styles_scripts' ) );
}
/**
* enqueue scripts and styles
*/
function enqueue_styles_scripts() {
/* enqueue parent style */
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
}
new ChildTheme;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment