WordPress twenty eleven featured scroll

Twenty eleven doesn’t scroll!

I’m a huge fan of wordpress and use it for most of my websites.  The software is dead on and so configurable that it can literally do anything that I need it to.  I’m a wordpress geek and I’m proud of it!

If you enable the WordPress showcase, you’ve probably wondered why the developers didn’t automatically scroll your featured “sticky” posts. This is totally annoying, but luckily we can do whatever we want with open source software!

Many sites that you vist (like mine) will feature a few posts and scroll them with an image scroller.  Twenty Eleven features the posts in text format, but does not scroll your sticky posts.  With the below code you can have your featured posts scroll and not worry about creating a wordpress image scroller.

WordPress featured scroll

I stumbled across a piece of code that will automatically scroll your featured posts. The code is:

<script charset="utf-8" type="text/javascript">// <![CDATA[
// Auto-advance the showcase slider
 // Source: http://pastebin.com/s6JEthVi
 jQuery(document).ready(function(){
 var change_every = 5; // The number of seconds that the slider will auto-advance in
 var current = 1;
 function auto_advance(){
 if(current == -1) return false;
 jQuery('.feature-slider a').eq(current % jQuery('.feature-slider a').length).trigger('click', [true]);
 current++;
 };
 setInterval(function(){auto_advance()}, change_every * 1000);
 });
// ]]></script>

Installing the twenty eleven scroll code

To get the code working, simply navigate to your dashboard. Once in the dashboard, edit the page that you’re utilizing the showcase theme on and paste the above code into the HTML section of the page. Save the page and you should experience immediate SUCCESS!

Author: David

View my first post on this blog for more information.

Leave a Reply

Your email address will not be published. Required fields are marked *