Skip to content

Instantly share code, notes, and snippets.

@philliproth
Created August 3, 2022 14:14
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 philliproth/d2ccbe7c91e2b0b84077e7749ad278a6 to your computer and use it in GitHub Desktop.
Save philliproth/d2ccbe7c91e2b0b84077e7749ad278a6 to your computer and use it in GitHub Desktop.
/* Example for child theme implementation */
function customname_register_scripts() {
$theme_version = wp_get_theme()->get( 'Version' );
wp_enqueue_script( 'customname-js', get_stylesheet_directory_uri() . '/assets/js/custom.js', array(), $theme_version, false );
wp_script_add_data( 'customname-js', 'async', true );
}
add_action( 'wp_enqueue_scripts', 'customname_register_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment