My enqueue scripts are never called I can’t figure out why. All my paths are correct and I’m assuming the code is correct
Functions.php
function tim_enqueue_default_scripts() {
if (ENVIRONMENT == 'dev') {
$globaljs = 'global.js';
$globalcss = 'global.css';
}
else {
$globaljs = 'global-0.3.min.js';
$globalcss = 'global-0.5.min.css';
}
wp_enqueue_script('globaljs', get_bloginfo('template_directory') . '/res/js/' . $globaljs . '', false, false, true);
wp_enqueue_style('globalcss', get_bloginfo('template_directory') . '/res/css/' . $globalcss . '', false, false, true);
}
add_action('wp_enqueue_scripts', 'tim_enqueue_default_scripts');
Header.php
<?php wp_head(); ?>
</head>
Footer.php
<?php wp_footer(); ?>
</body>
Be sure about the parameters wp_enqueue_style and wp_enqueue_script uses.(The parameters are not same for both )
you are giving false,false,true for dependency,version and media which is a blunder mistake.If you are not sure about them, you can avoid them and if you want to following is an example
and in wp_enqueue_script you need to change $deps(dependency) parameter to
array()
instead offalse
Try
wp_register_script()
andwp_register_style()
firsthttp://codex.wordpress.org/Function_Reference/wp_register_script
Something like (for the style at least):