SHARE
TWEET

Change Blogger popular post thumbnail size

mspotilas Jul 7th, 2012 10,223 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type='text/javascript'>
  2. //<![CDATA[
  3. // Change Blogger popular post thumbnail size using jQuery / MS-potilas 2012
  4. // Put this code in a html/javascript gadget (after popular posts gadget), or before </body>.
  5. // See http://yabtb.blogspot.fi/2012/07/resize-popular-post-thumbnail.html
  6. var newSize = 100;  // this is the new thumbnail size, you can change this
  7. $(".popular-posts .item-thumbnail img").each(function() {
  8.     var oldSize = $(this).attr("width");
  9.     $(this).attr("width", newSize); $(this).attr("height", newSize);
  10.     $(this).attr("src", $(this).attr("src").replace("/s"+oldSize+"-c/", "/s"+newSize+"-c/"));
  11. });
  12. //]]>
  13. </script>
RAW Paste Data
Top