Mostrar 15 resultados entradas populares

Pegué este código antes de </head>.
<script src='http://code.jquery.com/jquery-latest.js' type='text/javascript'></script>
y luego pegué este código antes de </body>.
<script type='text/javascript'>
//<![CDATA[
// Shuffle and limit count of Blogger popular posts using jQuery / MS-potilas 2011
// Put this code in a html/javascript gadget or before </body>.
// See http://yabtb.blogspot.com/2011/12/shuffle-and-limit-popular-post-gadget.html
var popcount = 15;
var ul = $('.popular-posts ul');
var lis = $('.popular-posts ul li').detach();
if(lis.length>1) {
for(var i=lis.length-1;i;i--) { // fisher-yates/knuth
var j=parseInt(Math.random()*i);
lis[j] = lis.splice(i,1,lis[j])[0]; // swap lis[i]&lis[j]
}
lis.slice(-popcount).appendTo(ul);
}
//]]>
</script>
Cambia el valor para mostrar mas entradas populares.
var popcount = 15;
Autor: MS-potilas
Url: http://yabtb.blogspot.com/2011/12/shuffle-and-limit-popular-post-gadget.html
No hay comentarios: