Last active
January 4, 2016 02:29
-
-
Save zogot/8555619 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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