Thursday, August 9, 2012

HOW TO INSTALL AUTO READ MORE IN BLOG


Auto Read More.Fungsion Auto is able to display the first image in the post and to fload image is in the beginning of the paragraph beginning, even though the picture we put in the middle or end of the posting. Maybe more comfortable I call it with a thumbnail image facility.

Not only that, we can also control the number of characters displayed. Here there are two options for the number of characters. The first, the number of characters displayed if there are images included in posts and secondly the number of characters without an image. Still confused mean? same .. , let same not dizzy just straight into the tutorial ok.

Important! Already installed Read More old version in the code should be used to return to normal, the way remove the red code below (Each template may be different, so stay adjusted only)










Readmore


OK, if you've lived proceed with the tutorial below.

First, please go directly to the page Edit HTML, find the code then put this script on the code If so, do not forget at the store first.

Directly copy paste the code below:


Auto-readmore link script, version 2.0 (for blogspot)

(C)2008 by Anhvo

visit http://en.vietwebguide.com to get more cool hacks
********************************************/
function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i")!=-1){
s[i] = s[i].substring(s[i].indexOf(">")+1,s[i].length);
}
}
strx = s.join("");
}
chop = (chop < strx.length-1) ? chop : strx.length-2;
while(strx.charAt(chop-1)!=' ' && strx.indexOf(' ',chop)!=-1) chop++;
strx = strx.substring(0,chop-1);
return strx+'...';
}

function createSummaryAndThumb(pID){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = summary_noimg;
if(img.length>=1) {
imgtag = '';
summ = summary_img;
}

var summary = imgtag + '

' + removeHtmlTag(div.innerHTML,summ) + '
';
div.innerHTML = summary;
}
//]]>



Please be saved and see the results:)

Description:
var thumbnail_mode = "float", (we can decide whether the location of the thumbnail in the (float) left, or if not, please replace the (no-float)
summary_noimg = 250; (Define how many characters will be displayed in the post without a picture / thumbnail)
summary_img = 250; (Define how many characters will be displayed in the post with the picture / thumbnail)
img_thumb_height = 120; (Thumbnail 'height in pixels)
img_thumb_width = 120; (Thumbnail 'width in pixels)


Good Luck..



0 comments:

Post a Comment

ShareThis

Related Posts Plugin for WordPress, Blogger...

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | coupon codes