image resize Jquery hack developed by MS-potilas and CSS3 by Spicyblogging.
Note:- ensure that you have installed latest jquery library in your template for showing random post on every page. If Not then please follow the step below and install jquery first:
Adding jquery
- Go to blogger dashboard > template > edit html
- Search for the following code (Need Help?)
- and paste the below code just after opening <head>
<head>
<script src="http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
how to shuffle popular posts content
- Go to blogger dashboard > template > edit html
- Search for the following code
- and paste the following code just before colsing body tag
</body>
<script type="text/javascript"> //<![CDATA[ // Random order to Popular Posts using jQuery / MS-potilas 2011 // Put this code in a html/javascript gadget or before </body>. // code written by: Ms-politas var ul = $(".popular-posts ul"); var lis = $(".popular-posts ul li"); 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.appendTo(ul); } //]]> </script>
Stylize Your Popular Content
Note that if you have already added a custom css code for styling popular posts gadget, remove completely before following the steps below, in case if you are satisfied with your current look just skip the below step and save your current editing by clicking on save button.- Search for the follow code in your template
- and paste the following code just above the "]]></b:skin>"
.popular-posts ul li {
font-weight: 700;
list-style: none !important;
margin: 0 0 10px !important;
overflow: hidden;
padding: 0 !important;
position: relative;
border: 0;
max-width: 100% !important;
height: 180px;
}
.popular-posts li a {
color: #FFF !important;
}
.popular-posts li a:hover {
color: #fff !important;
text-decoration: underline;
}
.PopularPosts .item-thumbnail {
margin: 0;
width: 100%;
height: 180px;
}
.PopularPosts ul li img {
display: block;
float: right;
padding: 0;
width: 100%;
height: 180px;
}
.PopularPosts .item-title {
bottom: 0;
left: 0;
right: 0;
padding-bottom: 0;
position: absolute;
z-index: 999;
}
.PopularPosts .item-title a {
background: rgba(142, 68, 173, 0.9);
display: block;
font-size: 16px;
line-height: normal;
padding: 15px 10px;
text-transform: capitalize;
}
.popular-posts ul li:before {
background: rgba(142, 68, 173, 0.8);
color: #fff;
content: float: left;
font-size: 25px;
line-height: 2px;
list-style-type: none;
padding: 5px 5px;
position: absolute;
top: 0;
}
]]></b:skin>
How To Change The Resolution Of Popular Post images
Update:- 2/9/2016
The parameter -c from /s72-c/ has been removed to ensure images are not cropped. The thumbnails will now look as you uploaded rather than cropped:
- Search for the follow code in your template
- and paste the following code just above the "</body>"
<script type="text/javascript">
//<![CDATA[
var newSize = 400; // this is the new thumbnail size, you can change this
$('.popular-posts .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+''));
});
//]]>
</script>
Note:-In the code above the variable "var newSize = 400;" which is calling the new size for images. You can increase the image size by changing variable i.e "150, 300, 400, 800 and last dimension is 1600". Note that the code will work If your images are uploaded to picasa.
</body>
I hope you enjoyed the above tips and applied successfully on your blog, if in case of any trouble please don't hesitate to ask us anything. Share your thoughts with us or if something missing here please let us know in the comment box below. Peace and Blessing bodies :)
No comments Post Yours!
Post a Comment