Support » Fixing WordPress » Problem loading scripts from functions.php

  • ch1ptune


    Hi there!

    I’ve been trying to integrate the carouFredSel caroussel jQuery plugin on my site using this tutorial:

    The idea is to load the jQuery script as well as the carouFredSel script in functions.php and then be able to use it on any desired page. jQuery loaded fine, but the carouFredSel script didn’t. In order to get it working I had to include the following code on the page desired: <script type="text/javascript" src=""></script>

    I’ve read somewhere that this is not the proper way to load a script and that it should be loaded via functions.php instead. Unfortunately, I haven’t had luck getting this to work.

    My functions.php (child) looks as follows:

    function my_scripts_method() {
    $jQuery = "";
    wp_deregister_script( 'jQuery' );
    wp_register_script( 'jQuery', $jQuery);
    wp_enqueue_script( 'jQuery');
    wp_register_script( 'carouFredSel', get_template_directory_uri() . '/wp-content/themes/responsive-child-theme/js/jquery.carouFredSel-6.1.0-packed.js',
    		array('jquery'), '5.5.0', true );
    wp_enqueue_script( 'stinnacarou',  get_template_directory_uri() . '', array('carouFredSel'), '', true);
    add_action('wp_enqueue_scripts', 'my_scripts_method');

    jQuery seems to load just fine, but does anyone have any idea why the carouFredSel script is unable to load from functions.php?

    Thanks in advance!


Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Problem loading scripts from functions.php’ is closed to new replies.