Skip to content

Instantly share code, notes, and snippets.

@vanaf1979
Last active January 3, 2020 20:02
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 vanaf1979/2669916bd47970982db3853daedabce1 to your computer and use it in GitHub Desktop.
Save vanaf1979/2669916bd47970982db3853daedabce1 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
$theme = wp_get_theme();
wp_enqueue_style( $theme->get('TextDomain') . '-styles', get_template_directory_uri() . '/style.css', array(), $theme->get('Version'), 'screen' );
wp_register_script( $theme->get('TextDomain') . '-scripts', get_template_directory_uri() . '/public/js/app.js', array(), $theme->get('Version'), true );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment