Skip to content

Instantly share code, notes, and snippets.

@zogot
Last active January 4, 2016 02:29
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 zogot/8555619 to your computer and use it in GitHub Desktop.
Save zogot/8555619 to your computer and use it in GitHub Desktop.
/**
* register Som Scripts to the Dom
* @param $isAdmin
* @return callable
*/
add_action("wp_enqueue_scripts", function() {
// Constantin CSS
wp_register_style(
"enquiss",
get_template_directory_uri() . "/style.css",
'1.0'
);
// Register Javascript Files
if (!$isAdmin)
{
// Register jQuery from CDN
wp_deregister_script('jquery');
wp_register_script(
"jquery",
"http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js",
array(),
"1.9.1",
true
);
wp_register_script(
"app",
get_template_directory_uri() . "/assets/js/dist/app-enquiss.min.js",
array("jquery"),
'1.0',
true
);
// ------------------------
}
// Enqueue needed scripts and stylesheets
if (!$isAdmin)
{
wp_enqueue_style("enquiss");
wp_enqueue_script('app');
}
});
wp_enqueue_style("enquiss");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment