On a recent PSD to Thesis project I needed to add testimonials to the sidebar. To make this feature a bit more interactive, I decided to use a sprinkling of jQuery to create an animated fader effect. Here’s how it was done:
Step 1 – The jQuery
You’ll need to create a new JavaScript file in your Thesis ‘custom’ folder, called fader.js. Because jQuery is already included with both WordPress and Thesis, you don’t need to include the jQuery library. So, in your fader.js file, add the contents of this file. Then save your fader.js file to your webserver and open your custom_functions.php file.
Step 2 – Call the jQuery file
In your custom_functions.php file, you’ll need to add the following function:
// jQuery header fader
function head_scripts() {
?>
<script type="text/javascript" src="<?php bloginfo(&#39;stylesheet_directory&#39;);?>/custom/fader.js"></script>
<script type="text/javascript">
jQuery(document).ready(
function(){
jQuery(&#39;#testimonials&#39;).innerfade({
animationtype: &#39;fade&#39;,
speed: 1000,
timeout: 8000,
type: &#39;sequence&#39;,
containerheight: &#39;370px&#39;
});
});
</script>
<?php
}
add_action(&#39;wp_head&#39; , &#39;head_scripts&#39;);
What this does is add the call to your fader.js file in your Thesis header and adds the animation effect to a div with an id of testimonials. Now we need to add the testimonials to our sidebar. The easiest way to achieve this is using a widget. So save your custom_functions.php file and open your WordPress admin panel.
Step 3 – The Testimonials widget
In the Appearance>Widgets pane of your WordPress admin panel, add a new text widget. Within the widget, you’ll need to add an HTML unordered list. Here’s an example:
<ul id="testimonials"> <li>This is my first testimonial. The client was very happy with my work. <span class="author">Joe Q Public</span></li> <li>I was so happy with the project that I overpaid. Who would have thought? <span class="author">Fred Bloggs</span></li> <li>I want to marry you Dave, and have your children... <span class="author">Angeline Jolie</span></li> </ul>
Save your widget and take a look at your sidebar in the front-end of your site. If you’ve done everything properly you should see an unstyled list of testimonials.
Step 4 – Add some style
Open your custom.css file (it’s in the custom folder of your Thesis installation). Add the following code to style your testimonials list.
ul#testimonials {
margin: 0;
padding: 0;
}
ul#testimonials li {
margin: 0;
padding: 0;
list-style: none;
}
ul#testimonials li span.author {
font-style: italic;
}
That’s it. You don’t need to limit this to testimonials of course. It would work quite well for images or blocks of text, and it doesn’t have to be inserted into a widget. The same code can be applied to a Post or a Page. Enjoy!

Hello, I’m Dave. I work with web design agencies, freelancers and bloggers to develop standards-compliant WordPress and Thesis themes.
{ 4 comments }
Awesome article. I’ll be implementing it on a site here soon! Tweeted too!
Nick´s last blog ..How to Get a Good Logo
Hi, great tutorial. I’m looking forward to getting it going but am unsure of how to place those folders and files in a .js file. Sorry i’m a JS loser. Any tips?
Hey Andrew, thanks for stopping by. It’s pretty straightforward getting the JavaScript files in.
1. Download the linked file above (in Step 1). Copy/paste the content into a new file called fader.js.
2. Upload the fader.js file to your Thesis Theme’s custom folder.
3. Copy/paste the snippet of code I reference in Step 2 into your custom_functions.php file.
4. Upload everything to your server. Done – except for the HTML.
If you can’t get it right and need help installing this, I’m for hire!
Dave, great tutorial. I see where Andrew had problem. I think novices are looking to dump the contents of the whole folder into a js file.
You basically need to clarify in Step 1 and add “Unzip the folder and find the jquery.innerfade.js – Rename the file to fader.js” or just provide the js in a seperate file for the tutorial.
Again, nice work. I’m eager to see the new theme. Thanks again, Jeff
Comments on this entry are closed.