Skip to content

Instantly share code, notes, and snippets.

@liamhiggins22
Created February 4, 2018 04:12
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 liamhiggins22/bcba9ace8a72e94a7305719bd2fb0662 to your computer and use it in GitHub Desktop.
Save liamhiggins22/bcba9ace8a72e94a7305719bd2fb0662 to your computer and use it in GitHub Desktop.
/**
* Theme assets
*/
function assets() {
wp_enqueue_style('sage/css', Assets\asset_path('styles/main.css'), false, null);
if (is_single() && comments_open() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_deregister_script( 'jquery' );
wp_enqueue_script('jquery', Assets\asset_path('scripts/jquery.js'), null, null, true);
wp_enqueue_script('popper/js', Assets\asset_path('scripts/popper.js'), ['jquery'], null, true);
wp_enqueue_script('sage/js', Assets\asset_path('scripts/main.js'), ['jquery', 'popper/js'], null, true);
}
add_action('wp_enqueue_scripts', __NAMESPACE__ . '\\assets', 100);
@defnesoganci
Copy link

if (!CLI_SCRIPT) {
echo('Command line scripts must define CLI_SCRIPT before requiring config.php'."\n");
exit(1);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment