Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active January 3, 2020 20:00
Show Gist options
  • Save vanaf1979/5a5a2ca0df529d3cea4964787940bd23 to your computer and use it in GitHub Desktop.
Save vanaf1979/5a5a2ca0df529d3cea4964787940bd23 to your computer and use it in GitHub Desktop.
Add a action to enqueue stylesGist for my "WorpdPress: Css Styles and Javascripts in theme development (In depth)" article: https://since1979.dev/wordpress-css-styles-and-javascripts-in-theme-development-in-depth/
<?php
function my_theme_enqueue_scripts()
{
/* Add a local javascript file */
wp_enqueue_script( 'my-theme-scripts', get_template_directory_uri() . '/public/js/app.js', array(), '1.0.0', true );
}
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_scripts' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment