Skip to content

Instantly share code, notes, and snippets.

@jauhari
Created December 13, 2016 16:33
Show Gist options
  • Save jauhari/02de0a079ecfa0f49252fec7cd942df5 to your computer and use it in GitHub Desktop.
Save jauhari/02de0a079ecfa0f49252fec7cd942df5 to your computer and use it in GitHub Desktop.
Sample Simple Child Theme WordPress
<?php
function my_theme_enqueue_styles() {
$parent_style = 'parent-style'; // This is 'twentyfifteen-style' for the Twenty Fifteen theme.
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')
);
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
// Custom Function to Include
function my_favicon_link() {
echo '<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />' . "\n";
}
add_action( 'wp_head', 'my_favicon_link' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment