A new thread was necessary for this issue thanks to sevenspark for helping me out but wanting more help from him could be abusing :))
So for example in order to get jcarousel working we normally need 3 scripts to include: jquery library, jcarousel and if we want to use seperately a trigger file that would be something like config.js. when I include these 3 between <script></script> tags (in header.php file), it works perfectly. But when I try wp_enque_script method by adding the code below functions.php:
<?php function my_load_scripts(){
wp_enqueue_script( 'jquery' );
wp_enqueue_script('jcarousellite', get_bloginfo('template_directory') . '/js/jcarousellite_1.0.1.js', array('jquery'));
wp_enqueue_script('config', get_bloginfo('template_directory') . '/js/config.js' , array('jquery', 'jcarousellite));
add_action('wp_head', 'my_load_scripts');
?>
It doesn’t work.. I thought it’s enough to add the code above to functions.php, what am I missing/doing wrong here?
You forgot an } bracket. You open the function my_load_scripts() but you doesn’t close it.
In addition to what BroOf said, it is probably better to use the wp_enqueue_scripts action instead of wp_head, e.g.
add_action(‘wp_enqueue_scripts’, ‘my_load_scripts’);
BroOf said
You forgot an } bracket. You open the function my_load_scripts() but you doesn’t close it.
I think I missed it while pasting I have it at my original code. but thanks for the heads up. and one more question: is that it that I have to do to enqueue scripts? I’m not missing something or forgetting calling some function somewhere (for example at header) etc ?
AkinGn said
BroOf saidI think I missed it while pasting I have it at my original code. but thanks for the heads up. and one more question: is that it that I have to do to enqueue scripts? I’m not missing something or forgetting calling some function somewhere (for example at header) etc ?
You forgot an } bracket. You open the function my_load_scripts() but you doesn’t close it.
That’s all you have to do, plus you have to change the wp_head to something else, like wp_enqueue_scripts or init.
Check out this link: http://wordpress.org/support/topic/wp_head-wp_enqueue_script-problem-loading-the-script-into-head-section
Thanks so much fillerspace, I hope I can figure it out. 
I managed to get some of the scripts to work via deregistering and re-registering the jquery, hopefully I’ö gonna get the other ones working too, thanks guys 
