Setting up the Nivo Slider in WordPress is a fairly similar process to setting it up on a normal HTML page. However to do it properly there are a few small differences and methods you should use that are WordPress specific.
Download and Setup
First off download the Nivo Slider and put it in your WordPress theme folder somewhere (for instance in “scripts/nivoslider”). You can put the CSS file in a separate folder if you wish but for simplicity I am just going to leave the contents of the download in the same folder. I’m also assuming here that you have your images in the “images” folder in your theme.
The HTML
Setting up the HTML for the slider is almost exactly the same as doing it in a normal HTML page. Something like the following:
<div id="slider">
<img src="<?php bloginfo("template_url"); ?>/images/slide_1.jpg" alt="" />
<img src="<?php bloginfo("template_url"); ?>/images/slide_2.jpg" alt="" />
<img src="<?php bloginfo("template_url"); ?>/images/slide_3.jpg" alt="" title="This is an example of a caption" />
<img src="<?php bloginfo("template_url"); ?>/images/slide_4.jpg" alt="" />
</div>
Note that images can have links and captions come from the images “title” attribute. We use the WordPress bloginfo() function to make sure we have the proper path to our images.
The PHP & Javascript
On to the fun part. Here is the code first for you “copy & pasters”.
<!-- Include jQuery -->
<?php wp_enqueue_script('jquery'); ?>
<?php wp_head(); ?>
<!-- Include the Nivo Slider CSS file -->
<link rel="stylesheet" href="<?php bloginfo("template_url"); ?>/scripts/nivoslider/nivo-slider.css" type="text/css" media="screen" />
<!-- Include the Nivo Slider JS file -->
<script src="<?php bloginfo("template_url"); ?>/scripts/nivoslider/jquery.nivo.slider.pack.js" type="text/javascript"></script>
<!-- Set up the Nivo Slider -->
<script type="text/javascript">
jQuery(window).load(function() {
jQuery('#slider').nivoSlider();
});
</script>
First off we are going to include jQuery the right way by using the WordPress wp_enqueue_script() function. Note that this has to be done before the wp_head() function.
Next we include the Nivo Slider CSS and JS files using the bloginfo() function to ensure the correct paths are used. Remember to alter the paths if the folder structure is different in your theme.
Finally we set up the jQuery script to load the Nivo Slider. Note that we need to use “jQuery” rather than just “$” as jQuery is in “no-conflict” mode. Now you should have a lovely slider on your WordPress site.
Update
Comments are now closed on this post. Please direct all support requests to the Support Forums.

How do I add all of the controls? using the above code works, but when I try to customize the slider, I break it. What am i missing? ALso the code entered this way breaks my jquery menu.
Help!
$(window).load(function() {
$(‘#slider’).nivoSlider({
effect:’random’, //Specify sets like: ‘fold,fade,sliceDown’
slices:15,
animSpeed:500,
pauseTime:3000,
startSlide:0, //Set starting Slide (0 index)
directionNav:true, //Next & Prev
directionNavHide:true, //Only show on hover
controlNav:true, //1,2,3…
controlNavThumbs:false, //Use thumbnails for Control Nav
controlNavThumbsFromRel:false, //Use image rel for thumbs
controlNavThumbsSearch: ‘.jpg’, //Replace this with…
controlNavThumbsReplace: ‘_thumb.jpg’, //…this in thumb Image src
keyboardNav:true, //Use left & right arrows
pauseOnHover:true, //Stop animation while hovering
manualAdvance:false, //Force manual transitions
captionOpacity:0.8, //Universal caption opacity
beforeChange: function(){},
afterChange: function(){},
slideshowEnd: function(){} //Triggers after all slides have been shown
});
});
I’m running into conflicts with my menu jquery,
Don’t you have to add the nivoslider class somewhere?
Hi.. I successfully implemented nivo slider onto my header, but the images are flashing all at once before the plugin loads.
I read somewhere that inserting this code would solve it:
[sourcecode]
$(window).load(function() {
$(‘#slider’).nivoSlider();
});
[/sourcecode]
I found a text file in under nivo plugin where it has ‘jQuery’ instead of the $ sign, so what I did is replace it with the dollar sign but it didnt fix the problem. How can I remove having my images flash all at once.
By the way, the plugin is now working and configured on my site. I placed this code in my index-top.php:
[sourcecode][/sourcecode]
Thanks in advance for any help and awaiting your reply
Sorry, second code I inserted in my index-top.php is the one I found here: http://wordpress.org/extend/plugins/wp-nivo-slider/installation/
Thanks!!! this is exactly what I was looking for
I’ve already integrated it.
Hi, I have this installed on a clients website and was seemingly working perfect until we tried in IE 7+ It appears for a second then disappears completely? Any ideas? http://www.sherrislawfirm.com
It seems I can get Nivo to work fine in Firefox, Chrome, etc,. but when the images load in IE they stack vertically down the page as if they were all on the same z-index.
Any ideas?
I thought I’d share an alternative method I used in installing Nivo Slider. I installed this as a text widget on WordPress 3.0 while avoiding having images flash all at once before the plugin loads. You can check it out here http://z3olyte.com/2010/06/30/use-nivo-slider-in-wordpress-as-a-text-widget/
Finally got it to run in IE8 by copying the css and html from the Nevo site source verbatim.
Unfortunately, the only way it will run is if the customization arguments are left blank in the window).load script.
A bit funky. Entering any option or effect parameter breaks IE.
Hi, really lovely this script, keep up the good work!
I’m trying to integrate this in a website and already managed to get it to work – almost. Look at this:
http://new.schoneweg.de/2010/07/06/test-20100706/
If you like at the example you see the the caption does “blink” always two times – the transition between the images – well, it blanks out in between.
It seems to me that this issues are related to each other – but after searching for several hours… I don’t have an idea why this happens.
Does anybody have a little hint? Any help would be greatly appreciated…
Thank you!
Hm, checking with firebug before the transi. the css looks:
element.style {
background:url(“wp-content/uploads/2010/07/slide_3.jpg”) no-repeat scroll -195px 0 transparent;
bottom:0;
display:block;
height:0;
left:195px;
opacity:0;
top:0;
width:39px;
}
and after the blinking the one element changes to:
background:url(“undefined”) no-repeat scroll -195px 0 transparent;
Ok, how to find out why the captions “blinks” (shows two times)
I thought I make another nivo slider tutorial… This seems to be my favorite plugin for my header
http://z3olyte.com/2010/07/08/set-up-nivo-slider-in-thematic-feature-site/
Hey,
It is possible to make/put instead of prew & next button – little images of prev & next articles ?!
Just let me know.
First up – awesome slider, thank you Gilbert.
For anyone having issues with displaying the slider in IE (v8, not sure on others yet) and you’re getting the friendly little yellow triangle telling you its “Expected identifier, string or number” error message, try removing the last comma after your customisation options – e.g, if your last customisation is “pauseOnHover: true,” – edit to say “pauseOnHover: true” instead.
You’ll need to add the other IE tweaks as doco’d on the Nivo Slider homepage as well, but this fixed it for me.
Cheers
I have the same problem with ie, if everyone used firefox or better yet chrome we wouldn’t have this problem!
So i’m trying to use the Nivoslider for http://nwmpmuseum.savvynat.com/?page_id=6 but for some reason whenever it transitions it goes really tiny and in the corner of the page? any help would be terrific!
I want to add this to my website, i did all the things above but the images are showing under echt other.. What do i miss? Does this work with wordpress 3.0?
Hi! great slideshow!!!
I tested in html simple page and was great!!!
But now, i want to put in the header of Mandigo WordPress Template, but i cant.. somebody have done it ? Actually i dont know where i must insert the code above explained in this page..
Can anyone help me ?
Thank you very much!
The slider is pretty awesome.
But I do have one problem. When my site loads up, all the slider images show up one below the other until the whole site loads up. Is their a way to not show the images until the page loads, or something like showing a loading symbol instead?
I am trying to set this but I cant follow the explaination you provided. I am fairly new to wordpress and would love some additional guidance. Maybe a novice tutorial
Thanks in advance
I dont mean to do a shameless plug in dev7studios but you might want to check out the tutorials in my site. Just do a search on nivo slider on my website.
Why is the animation so choppy? The slices only go upto 5. I even tried changing the values in the .js file. No difference.
It looks nothing like the demo slider on this site.
Hi Matt.. it must have something to do with the size of your images… try optimizing the file size of each image so they load smoothly.
Okay … so love the plugin … but I’ve got a bit of an issue:
I’ve got a custom post type of “portfolio” and would want the slider to get the information from the portfolio categories instead of the post categories.
Can you point me in the right direction?
Thanks,
Michael
i got wordpress 3.1 and my doenst work it shows a blanco page…
Heya, a quick tip on how to enqueue script and css in a clean way.
function scripts() {
if ( !is_admin() ) {
wp_register_script(‘nivo-slider-js’, ( get_bloginfo(‘template_url’) . ‘/js/jquery.nivo.slider.pack.js’), array(‘jquery’));
}
}
function styles() {
if ( !is_admin() ) {
wp_enqueue_style(‘nivo-slider’, get_bloginfo(‘template_url’) . ‘/css/nivo-slider.css’, false , ’2.1′, ‘screen’);
}
}
add_action( ‘wp_print_scripts’, ‘scripts’);
add_action(‘wp_print_styles’, ‘styles’);
Sorry, forgot to mention that you may put the code in your theme’s functions.php
I had this all working fine (locally) but when I try to take it to a live beta site all the images in the slider link to 1 place…
Any ideas?
http://ellistonsystems.com/beta2010/
I have the slider installed and everything works well except for one thing: when the page first loads and the user clicks on the first image, it doesn’t click through to the correct blog post. It clicks to the last post. This behavior only lasts while the first image is up. Once the second one fades in, all images go to the correct posts. The site is here: http://www.habitude.com/wp . Any help would be appreciated. Thanks!
well anybody helping me?:p or did george best just helped me?
like i said i got wp 3.1
http://www.stiloloko.com/Nieuwe%20map/index.php
u see its blanco (and if doesnt show the script)
<img src="/img/advertise/advertisement-vidaloca.jpg” alt=”advertisement-vidaloca.jpg” />
<img src="/img/advertise/advertisement-dans.jpg” alt=”advertisement-dans.jpg” />
Hi,
We tried using Nivo slider with larger images than the ones on the sample, but it’s cropping the images. Would anyone know how to make Nivo slider work with larger images? i.e. width =700px
Hey guys,
I have implemented this no problems on my MAMP installation on my mac, however when I upload everything to my web server I just get the slider div with 2 images one above the other, nothing works,
Im using the correct paths with bloginfo(“template_url”) or whatever it is, please help?
Is there anything I need to let my webhosting know to turn on in the apache setup or anything like that? Thanks
Mike.
Hi everyone,
Same thing for me! I’m suing wordpress 3.1 and images are just stacking up but nothing more…
I’ve successfully used Nivo Slder before but somehow this isn’t working anymore.
Any pointers from anyone?
Thanks.
thanks.very informative articles and discussion.
I was looking for such effect.Nice.
thanks
He guts,
great job with Nivo. I’m working with the WordPress plugin and I like it to use ‘the_post_thumbnail();’ for the images and ‘the_post_thumbnail(‘thumbnail’);’ for the thumbnail navigation. Any idea on how to add this?