. // See http://yabtb.blogspot.fi/2012/07/resize-popular-post-thumbnail.html var newSize = 150; // this is the new thumbnail size, you can change this $("#PopularPosts1 .item-thumbnail img").each(function() { var oldSize = $(this).attr("width"); $(this).attr("width", newSize); $(this).attr("height", newSize); $(this).attr("src", $(this).attr("src").replace("/s"+oldSize+"-c/", "/s"+newSize+"-c/")); }); //]]>