a jQuery slideshow plugin
it's easy
The package is based around the way you already build your website, so you don’t have to retain swaths of arbitrary knowledge to use it on a regular basis.
it's small
At 15kB for the full version, and a minute 6kB for the hyper-compressed version, and tidy code, this plugin won’t bog down your site
or burn out your users’ browsers, even using it in multiple iterations per page.
it's flexible
With the little markup you need to add to your site, you get a full featureset, like the ability to put whatever data you want within the slide window, even mixed types, a proportionally-correct status display that configures itself, fullscreen display and swipe functionality.
it's neat
Add some slick usability
to your site with a plugin that’s fun and easy to use. And if you have any other questions, I’ll be happy
to help you out.
<?php wp_enqueue_script("jquery"); ?>
<?php wp_head(); ?>
wp_enqueue_script tag tells Wordpress that you don't want it to use the copy of JQuery it likes and you will specify your own. I like using Google's JQuery API, but you can also reference a copy of the script locally. After wp_head, you'll include the JQuery script and the SimpleSli.de script like this:
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="<?php bloginfo('template_directory'); ?>/js/simpleSlide.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready( function(){ simpleSlide(); });
</script>
header.php now, so you can save and close it and open up the file you want to have the slider on, in my case index.php. All I added to my code here was an include() to a new file we'll create just to keep the SimpleSli.de code a little separate and easily include it on any additional pages in the future. To include a file in php, just use <?php include ('slider.php') ?>
<div class="slider">
<div class="left-button" rel="1"></div>
<div class="right-button" rel="1"></div>
<div class="simpleSlide-window" rel="1">
<div class="simpleSlide-tray" rel="1">
<?php query_posts('category_name=Featured&showposts=5'); ?>
<?php while (have_posts()) : the_post(); ?>
<div class="simpleSlide-slide" rel="1">
<div>
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'thumbnail' ); ?></a>
</div>
</div>
<?php endwhile; ?>
<?php rewind_posts(); ?>
</div>
</div>
</div>
div. I've added the class of .slider too. This just makes it easier for me to position later. Lines 2 and 3 create a previous and next button that we can style and position using CSS. They both have a rel="1" tag and it needs to match the same rel tag used by the slider. That's how SimpleSli.de can tell what the buttons are meant to manipulate. The .simpleSlide-window and .simpleSlide-tray are just necessary components of the script and explained better than I could on the SimpleSli.de website (Ed: Check out the "features" section).showposts can be set at 1 or higher, but if you set it too high and a lot of post information needs to be pulled, you'll be slowing your site down unnecessarily. Line 8 is the beginning of the slide format that each slide will share. There's only one slide in the code here because Wordpress will use this as a template to create a slide for each post. Within this example, the thumbnail of each post is displayed and linked to the post itself. It's important to keep rewind_posts or your page won't be able to use another query as well. the_post_thumbnail might not be enabled; I'll explain how to do that in a few more paragraphs. If you want to customize what's displayed in each slide, just edit lines 10-12 with the code of your choice to keep it easy.functions.php and add the lineadd_theme_support( 'post-thumbnails' );
.simpleSlide-slide div {
height:300px;
width:600px;
}
height and width as you like, but make sure to also set the thumbnail size to match or you'll have unattractive extra space or images cut off by the available area. Feel free to ask me any questions regarding the usage but also understand that my support is limited by my time and I may not be able to help you with specifically configuring your site or a unique problem you may be having.