Domanda

URL: http://oscarjacobs.rapdevs.co.uk/

When I include a link to jquery-1.9.1.min.js in my header, my jCarousel featured slider works, but my main slide show at the top stops working.

I found http://css-tricks.com/snippets/wordpress/include-jquery-in-wordpress-theme/ and added the following to my theme's functions.php file...

if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11);
function my_jquery_enqueue() {
   wp_deregister_script('jquery');
   wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js", false, null);
   wp_enqueue_script('jquery');
}

My jCarousel featured slider still doesn't work. Any advice would be greatly appreciated.

Thanks in advance!

È stato utile?

Soluzione

Change the last script to:

<script type="text/javascript">
    jQuery("ul.products").last().addClass("jcarousel-skin-tango");
    jQuery('ul.jcarousel-skin-tango').attr('id', 'mycarousel')
</script>

Here it is working - http://jsbin.com/eruweb/1

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top