Bootstrap Carousel Error == TypeError: $(…).carousel is not a function

I know this has been asked before but the related post was different in approach and also the fiddle example was removed..

MY Situation:
I downloaded the entire Bootstrap form here:
http://getbootstrap.com/getting-started/ (the “Bootstrap” folder)

Read More

I added those files to my themes folder,
created the style.css and functions.php and also a page.php and a index.php

Then I enqueued Bootstrap CSS + JS in my custom theme’s function.php with this code:

    function enqueue_my_scripts() {
wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', array('jquery'), 'null', true); // we need the jqyery library for the Bootstrap plugins
wp_enqueue_script( 'bootstrap-js', 'js/bootstrap.min.js', array('jquery'), true); // all the Bootstrap javascript plugin goodness
}
add_action('wp_enqueue_scripts', 'enqueue_my_scripts');
function enqueue_my_styles() {
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css');
wp_enqueue_style( 'my-bootstrap-style', get_template_directory_uri() . '/style.css', array(bootstrap-style)); }
add_action('wp_enqueue_scripts', 'enqueue_my_styles');

I then used the wp-types Plugin “Layouts” to generate a Layout that includes a Image Slider

This slider does only display the first image, and none of the button works, nor the auto play.

The error is:

TypeError: $(...).carousel is not a function

Now I am noob, I don’t know what I must do.

I have in my theme a page.php and a index.php, both do include the code to integrate the Layouts Plugin
(for this, you remove the default WP Loop and replace it with

<?php
 the_ddlayout();
?>

The Plugin “layouts” does not add new template files to your theme folder, but stores them in DB

I understand only that this error says that this is not a function.
Must I somehow register that function first in my theme?

Can somebody point me to a solution’s approach?

I very much appreciate.

I would very much like to add a image… but i need more reputation tells me the editor.

you can see the situation if you visit the sample-page in the website yoonect.

Related posts

Leave a Reply

1 comment

  1. From TypeError: $(...).carousel is not a function it seems like that jquery is not loaded properly.

    Try the below modified function for scripts:

    function enqueue_my_scripts() {
    wp_enqueue_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js', array('jquery'), '1.9.1', false); // adding in header
    wp_enqueue_script( 'bootstrap-js', get_template_directory_uri().'/js/bootstrap.min.js', array('jquery'), true); // addition of 'get_template_directory_uri()'
    }
    

    Hope it helps…