Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

Tuesday, September 21, 2010

How To Add Auto Read More Feature In Single Script

This is a very simple single script hack for auto read more function for those who new in blogging world.

This are the simple steps.

Log in your blogger account , go to Edit HTML ( should back up your template) > choose Expand Widget Tempate , then look for the code <data:post.body/> ( press Ctrl F or find it each line , up to you) 
Replace it by this whole code :
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'/>
<script type='text/javascript'>
var blogID = &quot;937920098338306331&quot;;
function retriveSummaryPost<data:post.id/>(json){document.getElementById(&quot;summary<data:post.id/>&quot;).innerHTML
= json.entry.summary.$t + &quot;...&quot;}
function createSummaryPost<data:post.id/>(POSTID){ var script =
document.createElement(&quot;script&quot;);
script.src = &quot;http://www.blogger.com/feeds/&quot;+blogID+&quot;/posts/summary/&quot;+POSTID+&quot;?alt=json-in-script&amp;callback=retriveSummaryPost<data:post.id/>&quot;;
script.type = &quot;text/javascript&quot;; document.getElementsByTagName(&#39;head&#39;)[0].appendChild(script);
}
</script>
<script type='text/javascript'>
createSummaryPost<data:post.id/>(&quot;<data:post.id/>&quot;);
</script>
<span class='rmlink' style='float:right'><a expr:href='data:post.url'>--&gt;Read more...</a></span>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='post_body'><data:post.body/></div>
</b:if>
Look for the red code, that is the number of your blogID

Find in this picture

Note: If you can not find the code <data:post.body> because you have changed your template source many times, so try with the last <data:post.body> as you see.

Saturday, August 28, 2010

Page Navigation with number For Blogger

Page navigation is need for all blogger because it can make navigation easy for your visitors.
 




To see the result go my home page.
 
 
Step 1 : Apply Style

  1. Login to Blogger Dashboard and navigate to Layout > Edit Html
  2. Don’t click the checkbox which says ‘Expand Widget Templates’
  3. Find this 
]]></b:skin>
and replace it with
.showpageNum a {
padding: 3px 8px;
margin:0 4px;
text-decoration: none;
border:1px solid #999;
-webkit-border-radius:3px;-moz-border-radius:3px;
background: #ddd;
}
.showpageOf {
margin:0 8px 0 0;
}
.showpageNum a:hover {
border:1px solid #888;
background: #ccc;
}
.showpagePoint {
color:#fff;
text-shadow:0 1px 2px #333;
padding: 3px 8px;
margin: 2px;
font-weight: 700;
-webkit-border-radius:3px;-moz-border-radius:3px;
border:1px solid #999;
background: #666;
text-decoration: none;
}
]]></b:skin>


Step 2 : Aplly Javascript

Find This :
</body>
Replace with :
&lt;script type='text/javascript'&gt;
var home_page=&quot;/&quot;;
var urlactivepage=location.href;
var postperpage=7;
var numshowpage=4;
var upPageWord ='Prev';
var downPageWord ='Next';
&lt;/script&gt;
&lt;script src='http://scriptabufarhan.googlecode.com/svn/trunk/pagenaviv202-min.js' type='text/javascript'&gt;&lt;/script&gt;
</body>
Change based on your blog setting :
var postperpage=7;
var numshowpage=4;
Postperpage : How many Post every Page for your blog
numshowpage : how Many number will show in Your page Navigation
Step 3 : Customize Label
Go to the Edit HTML page and “Expand Widget Templates
Find this (all of this text in your xml or template)
'data:label.url'
and Replace with this
'data:label.url + "?&max-results=7"'
Change 7 base on how many post every page
only That, I hope it can work and make your blog easy to navigate.

Thursday, May 20, 2010

Automatic Read More Hack For Blogger With Thumbnail

Automatic Read More Hack For Blogger With Thumbnails i.e expandable post hack for blogger with thumbnail of image used in blogger posts and all this work is done by the script automatically,you just dont need to locate your image the script will do all work for you automatically.Just you have to write your post and publish it with one image in post related to post.

If you dont want to add thumbnail image in post summary then i had an post previously on automatic read more hack for blogger,read this.

Now how to install Automatic Read More Hack For Blogger With Thumbnails Demo snapshot is below.


Lets start with its installation:-

Now Login to Blogger Go to Layout > Edit HTML in your Blogger dashboard and check the "expand widget templates" box.

Find the closing </head> tag in your blog template, and paste the following section of code immediately before it:
<script type='text/javascript'>var thumbnail_mode = "no-float" ;
summary_noimg = 430;
summary_img = 340;
img_thumb_height = 100;
img_thumb_width = 120;
</script>
<script type='text/javascript'>
//
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 = '<span style="float:left; padding:0px 10px 5px 0px;"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px"/></span>';
summ = summary_img;
}

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


//]]>
</script>
Note in above codes we can change the numeric numbers according to our need

summary_noimg = 430; is post cut height without image
summary_img = 340; is post cut height with image
img_thumb_height = 100; is thumbnail image height
img_thumb_width = 120; is thumbnail image width

Now find this code <data:post.body/> in your template and replace it with below codes.

<b:if cond='data:blog.pageType != "item"'>

<div expr:id='"summary" + data:post.id'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb("summary<data:post.id/>");
</script> <span class='rmlink' style='float:right;padding-top:20px;'><a expr:href='data:post.url'> read more "<data:post.title/>"</a></span>

</b:if>
<b:if cond='data:blog.pageType == "item"'><data:post.body/></b:if>
Preview Your template if its showing thumbnail with read more hack Save it.

To show thumbnail it should have one image in your blogger posts and please upload the .js file to your server and dont forget to change the link with yours in codes to make this hack work.

I am sure everybody will love this hack for sure.babai

Thursday, March 25, 2010

Google Buzz share count button for Blogger / Blogspot blogs

Integrate Google Buzz Button in Blogger with some simple hacks is very easy now. After introducing Google Buzz in global market now buzz have started to dominate the micro blogging arena and every blogger wants to Add Google Buzz Button in Blogger Blogs, With this service users can now share the stuffs with each other. Google have not provided any script for adding a social bookmarking button for your blog. So if you want to Add the Google buzz Button in your Blogspot blogs then follow the steps given below here.

How to Add Google Buzz Button in Blogger:

Step 1: Login to Your Blogger Account.

Step 2: On Your Dashboard, Click on Layout

Step 3:Now Click on HTML

Edit HTML

Step 4: Now Check the box of Expand Widget Templates
Note: Before Applying Any Changes Please Download the Full Template for your Backup.

Expand template code

Step 5: Now you can add the Google Buzz Button either at the end of the each post or below the title of the each post.

Step 5.1: If you want to add the button at the end of each post then find this code in your template.

<data:post.body/>
Now paste this code belowe
<script src="http://www.buzrr.com/button.js"></script>

Now Save Template.

If you want more stylish and different button click on Image.

 
Reblog this post [with Zemanta]

Friday, March 12, 2010

Animated Image Icon Before Post Titles in Blogger / Blogspot

Blogging is all about providing valuable information to your readers. In addition to this, you can customize your blog in such a way that your readers would enjoy your blog layout with the contents. So, here is the tip to add and show animated image icon before blogger post titles. It will be displayed as the logo to your each post on blogspot. This can be done with some simple HTML edits. Lets learn this blogger trick step by step.

Finding An Image Icon To Insert Before Blogger Post Titles :

First things first. You have to do some homework before adding animated image icons. First of all you have to find an icon to place in your blog. The maximum size of your icon should be 50*50 pixels. You may make a search on Google with search phrases like “Animated icons”, “Animated logos” and choose an image. See if the image you have choosen is not protected under any copyright law. Try to get an icon which blends perfectly with your blog theme. Then upload your icon to any image hosting
site such as imageshack, photobucket, tinypic or googlepages etc and get the link to your image. When you are done with this, proceed to next step.

Making HTML Code For Your Image Icon :

After getting the link to your image icon it’s time to make a HTML code using the image link. Follow below code to make a HTML code using the link to your animated icon.

<img src="LINK TO YOUR IMAGE HERE" style="border-width:0px" />

Change the text LINK TO YOUR TEXT HERE with the link to your image. Now I guess you are done with the HTML code to your link. Move to the next step.

Editing HTML To Insert Image Code

Now it’s time to implement the above code in your blogger template and your blog will start showing your icon before blogger post titles. To do this follow below mentioned steps.

1. Go to your blogger dashboard.
2. Navigate to Layout >> Edit HTML
3. Expand Widget Templates by clicking the box next to it
4. Search for the below code in your template by pressing Ctrl+F on your browser
<b:if cond="data:post.url">
5. Add your image HTML code just above this code in your template.
6. Save the template and you are done.

Now you can see an animated image icon before all your post titles on blogger/blogspot. You can also apply this trick to add some special notes before your post titles. Simply post your text in place of the image icon code in your blogger template code and you are done.
Reblog this post [with Zemanta]

Friday, February 12, 2010

Add a Subtitle to Blogger Posts

This Blogger tutorial shows you how to easily and quickly add a subtitle to your Blogger posts (Blogspot posts) so that both search engines and readers will have more information about your post.This is an easy tweak to your Blogger blog that anyone can carry out in a couple of minutes.

Benefits of Using Subtitles in Posts
Adding a subtitle which appears below the title of your post can be both eye catching and informative. For instance a titling schema for this post could be:

Title: Add a Subtitle to a Blogger
Subtitle: Make Your Posts More Search Engine Friendly and User Friendly

If you craft your titles and subtitles carefully you will encourage more targeted readers of your blog as they will be able to see at a glance what your post is about rather than reading the whole article. Your traffic therefore might be slightly less but they will be far more targeted to the content of your site resulting in a lower bounce rate.