Skip to content

Instantly share code, notes, and snippets.

@codearryaas
Created February 7, 2019 08:45
Show Gist options
  • Save codearryaas/c171ce2f4a334e99f3b498947b98efd4 to your computer and use it in GitHub Desktop.
Save codearryaas/c171ce2f4a334e99f3b498947b98efd4 to your computer and use it in GitHub Desktop.
<?php
/**
* Js & Css assets for child theme.
*/
function twentynineteen_child_assets() {
wp_enqueue_style( 'twentynineteen-style', get_template_directory_uri() . '/style.css' );
if ( ! is_front_page() ) {
return;
}
wp_enqueue_style( 'twentynineteen-child-style', get_stylesheet_directory_uri() . '/style.css' );
wp_enqueue_script( 'twentynineteen-script-name', get_stylesheet_directory_uri() . '/assets/js/dist/bundle.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'twentynineteen_child_assets' );
// More to come.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment