Wednesday, March 28, 2012

How To Add Related Posts Widget To Blogger with Thumbnails

Now here is a wonderful hack for displaying related posts beneath each of your blog posts along with post thumbnails. The related posts are picked from other posts having same category/label/tag. With this hack many of your readers will remain on your site for longer periods of time when they see related posts of interest.

related post, related posts blogger, blogger widgets

Adding the Related Posts Widget to Blogger/Blogspot

Step 1. Log in to your Blogger account and go to Template > Edit HTML

blogger template, edit html

Step 2. Click anywhere inside the code area and press the CTRL + F keys:

blogger search box, CTRL + F

Step 3. Search for this tag that you need to add inside the search box (hit Enter to find it):
</head>
Step 4. Copy and paste the below code just before/above the </head> tag:
<!--Related Posts with thumbnails Scripts and Styles Start-->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<style type='text/css'>
#related-posts{float:left;width:auto;}
#related-posts a{border-right: 1px dotted #eaeaea;}
#related-posts h4{margin-top: 10px;background:none;font:18px Oswald;padding:3px;color:#999999; text-transform:uppercase;}
#related-posts .related_img {margin:5px;border:2px solid #f2f2f2;object-fit: cover;width:110px;height:100px;-webkit-border-radius: 5px;-moz-border-radius: 5px; border-radius: 5px; }
#related-title {color:#333;text-align:center;text-transform:capitalize;padding: 0px 5px 10px;font-size:12px;width:110px; height: 40px;}
</style>
<script type='text/javascript'>
//<![CDATA[
var relatedTitles=new Array();var relatedTitlesNum=0;var relatedUrls=new Array();var thumburl=new Array();function related_results_labels_thumbs(json){for(var i=0;i<json.feed.entry.length;i++){var entry=json.feed.entry[i];relatedTitles[relatedTitlesNum]=entry.title.$t;try{thumburl[relatedTitlesNum]=entry.gform_foot.url}catch(error){s=entry.content.$t;a=s.indexOf("<img");b=s.indexOf("src=\"",a);c=s.indexOf("\"",b+5);d=s.substr(b+5,c-b-5);if((a!=-1)&&(b!=-1)&&(c!=-1)&&(d!="")){thumburl[relatedTitlesNum]=d}else thumburl[relatedTitlesNum]='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP06VnjnmyiCW9aA9QlEQGgVpN9s2SxdwBZLl8PBQ4LRGINa3Vs5K5i7bMyYHWjiN0KMYsDWkfHb0_iC4iauL53S7GIMam7yBabLuoKHAn3fMTg5cwuenLN_KhFASkz5NefWp75Hvww2bJ/s1600/no-thumbnail.png'}if(relatedTitles[relatedTitlesNum].length>35)relatedTitles[relatedTitlesNum]=relatedTitles[relatedTitlesNum].substring(0,35)+"...";for(var k=0;k<entry.link.length;k++){if(entry.link[k].rel=='alternate'){relatedUrls[relatedTitlesNum]=entry.link[k].href;relatedTitlesNum++}}}}function removeRelatedDuplicates_thumbs(){var tmp=new Array(0);var tmp2=new Array(0);var tmp3=new Array(0);for(var i=0;i<relatedUrls.length;i++){if(!contains_thumbs(tmp,relatedUrls[i])){tmp.length+=1;tmp[tmp.length-1]=relatedUrls[i];tmp2.length+=1;tmp3.length+=1;tmp2[tmp2.length-1]=relatedTitles[i];tmp3[tmp3.length-1]=thumburl[i]}}relatedTitles=tmp2;relatedUrls=tmp;thumburl=tmp3}function contains_thumbs(a,e){for(var j=0;j<a.length;j++)if(a[j]==e)return true;return false}function printRelatedLabels_thumbs(){for(var i=0;i<relatedUrls.length;i++){if((relatedUrls[i]==currentposturl)||(!(relatedTitles[i]))){relatedUrls.splice(i,1);relatedTitles.splice(i,1);thumburl.splice(i,1);i--}}var r=Math.floor((relatedTitles.length-1)*Math.random());var i=0;if(relatedTitles.length>0)document.write('<h4>'+relatedpoststitle+'</h4>');document.write('<div style="clear: both;"/>');while(i<relatedTitles.length&&i<20&&i<maxresults){document.write('<a style="text-decoration:none;margin:0 4px 10px 0;float:left;');if(i!=0)document.write('"');else document.write('"');document.write(' href="'+relatedUrls[r]+'"><img class="related_img" src="'+thumburl[r]+'"/><br/><div id="related-title">'+relatedTitles[r]+'</div></a>');if(r<relatedTitles.length-1){r++}else{r=0}i++}document.write('</div>');relatedUrls.splice(0,relatedUrls.length);thumburl.splice(0,thumburl.length);relatedTitles.splice(0,relatedTitles.length)}
//]]>
</script>
</b:if>
<!--Related Posts with thumbnails Scripts and Styles End-->

Note:
- to change the width and height of thumbnails, modify the 110px and 100px values in red
- to change the color and size of related posts titles, change the #333 color value in blue
- remove the line in violet if you want the related posts to be displayed both in homepage and post pages.

Step 5. Find the line below (you will find two times, but you need to stop at the second one):
<div class='post-footer'>
Step 6. Just above <div class='post-footer'> paste this code:
<!-- Related Posts with Thumbnails Code Start-->
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div id='related-posts'>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.isLast != &quot;true&quot;'>
</b:if>
<script expr:src='&quot;/feeds/posts/default/-/&quot; + data:label.name + &quot;?alt=json-in-script&amp;callback=related_results_labels_thumbs&amp;max-results=5&quot;' type='text/javascript'/></b:loop>
<script type='text/javascript'>
var currentposturl=&quot;<data:post.url/>&quot;;
var maxresults=5;
var relatedpoststitle=&quot;<b>Related Posts:</b>&quot;;
removeRelatedDuplicates_thumbs();
printRelatedLabels_thumbs();
</script>
</div><div class='clear'/><div style="font-size: 9px;float: right; margin: 5px;"><a  style="font-size: 9px; text-decoration: none;" href="http://blogger.chipchuck.com/2012/03/how-to-add-related-posts-widget-to.html" rel="nofollow" >Related Posts Widget</a></div>
</b:if>
<!-- Related Posts with Thumbnails Code End-->
Note:
- change the 5 value from max-results=5 with the number of posts you want to be displayed
- if you want the related posts to be displayed on homepage too, then remove the b:if lines in violet

Update! If you are unable to see the related posts widget after saving the template, add the code (step 5) just above the </b:includable> tag that you can find above this line:
<b:includable id='postQuickEdit' var='post'>
To get an idea of the exact location, see the screenshot below:


Step 7. Save the Template and that's it. Now the Related Posts widget with Thumbnails should appear below each Blogger post that has labels on it. Enjoy!

How to change Blogger "Post A Comment" Message

While the main secret of getting comments is to have good friends and creating good content, sometimes it is difficult getting more comments when we have a brand new blog that is not visited very often. A pretty good technique is to put images to encourage visitors to comment.

blogger post a comment
This tutorial will show you how to replace the 'Post A Comment' text that appears above the comment form with an image. Also, below are some images that you can use but you can also add your own image, that depends on your tastes. So, let's proceed with the steps...

How to replace Post a Comment with an image

In order to replace "Post A Comment" message in Blogger / Blogspot, follow the steps below:

Step 1. Log into your Blogger account and select your blog.

Step 2. Go to "Template" and press the "Edit HTML" button

blogger template edit html
Accessing Blogger template editor
Step 3. Click anywhere on the code area, then press the CTRL + F keys and search for this code (if you can't find the entire code, then search only for the one in red and you should see the rest of it):
<a expr:href='data:post.addCommentUrl' expr:onclick='data:post.addCommentOnclick'>
<data:postCommentMsg/></a>
...and for this one too:
<h4 id='comment-post-message'><data:postCommentMsg/></h4>
Step 4. Replace <data:postCommentMsg/> with one of the below image URLs:

<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjD10bS2IsiwxEETX_wolkP8KrNP6Irblh16l-9gYJLEExnL452hO2loXI6S_VwUotwh14qwFrH6d7eJdv00cLkhf5VwGwSTsKPC3qeoTO6h3HrNgtv8UrJSx3qfsrYnCLYb6p48DkKZAg/s1600/leave+a+comment.png" />


<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhlJBNOr0BpBvoBMek5q0rZ1BwR7sqXS8ynO1NA65boPxyRWiiH1l34VDZap5Akecjt8gnkiJgkT0UUbKK0NXz-CfL0Rcll6-MZoXB3HVRq13nNDv-P8LLfWzdJ1EW7AgmCMe5mavqMc1I/s1600/Post+a+comment+blogger.png" />


<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgr9Op-O-uRt-hVQ3NARN3kb12_KTazg4waPgTxowQFsaGG5LWsvnyFz-aBbfiU3nBAYHQHE_59bxnSpxCZRFiyO5emt_9QrVl5krTPc6h4TtZBFHw2XnWNdc9P4UsGMoJiqlxlIAA83-r/s1600/animated+comment+arrow.gif" />


<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5ffK6LjkSgg9gi5_HrG4qAG4gaUCBm3-twX7tmoQH1gm72jXoLA2T4UepbfWR8AjZakMpHHVkqUZ-2LU8P0J9R-Zvi_Vlg2gqjelRHYUiUu2JBNuo7qngrleTURXuVGdJBKqnXWB82Vbc/s1600/leave+a+comment2.png" />


<img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhIusQN_sNZywClIvienWDMQ9eUfbRUr1Km6RaJkNr2ZF50yK-Jhno21g3MxUOmWJoKIkKP57p0cc-EeSZCr2wmze5P-RYFdShiz7KiDFq4WAIbCc5DXhmppfRoNkad1FO2WI809IxxlRK0/s1600/comment.gif" />

If you haven't found an image on your tastes, you can use your own image instead. Just upload your picture on Blogger, switch to Edit HTML tab, copy the image code and replace <data:postCommentMsg/> with your code.

UPDATE! Step 5. The first steps will replace the 'Post a Comment' text only when there are no comments available. To show the image each time new comments are added, add the code of the image after the 4th of the below code (you'll find it in more than one location):
<p><data:blogCommentMessage/></p>

Also, if you want to center the picture, just place the code in between the <center></center> tags like this:
<center><img src="Image-URL"/></center>

Step 6. Click the 'Save Template' button and you are done.

So this is how we can change Blogger 'Post a Comment' message or text. Hope you enjoy your new comment form!

Sunday, March 25, 2012

How to optimize Images and Increase Blog Traffic

This tutorial will explain you how to optimize images before uploading them on your blog. Generally, most of people don't optimize images before uploading it to Blogger as needed. Optimizing images should be done if you want to improve the SEO (Search Engine Optimization) or your blog or site. Learning the correct and proper way of optimizing images in Blogger is also very important.

Google Image search is used widely for finding quality reference images, icons or photos. A great percentage of our blog traffic depends on Image search. But the problem is that, when we are downloading images they are saved with odd names and we don't take any interest in modifying the name. So, we should always consider two things when uploading images on our blog - the proper use of the alt tag and changing the name of the images or pictures choosing the right SEO keywords.

1. Change Image Name with Keyword

optimize images

As mentioned above, most of the picture we are downloading on our hard drive are usually saved with names that make no sense like untitled.png, img0643.png etc. So changing these names with appropriate keywords is always helpful. For instance, if I want to add img or untitled in this post, then I would definitely change these name with those words - or keywords - that would describe the best my content; thus, if I want to add an image to a post about SEO topics, then I would name it something like SEO.png or seo-optimize-images.png so that it would be relevant to the post content.

2. Use the alt Attribute on an Image Tag

Search robots cannot read multimedia, be it graphic images or flash. An image is meaningless for search spiders if it is not defined (tagged). Therefore, in order to tell the search robots what the image is about, we can add an alt tag to our image code - when we upload a photo inside the post editor, click on the image and then click on the "Properties" link below it:

optimize image for seo

After clicking on the "Properties" link, the Image properties box will popup. Inside the Title text section, type a relevant title for your image, while in the Alt text section, type a short description of your image... then press OK.

seo optimizing images, images alt title

It is recommended to write short sentences to describe your pictures and to keep the description limited to 4-5 words. Less is better. Also, make sure you don't use the same words and try to mix up your image keywords.

These are simple tips for SEO image optimization which are not only effective for your SEO but can also boost your traffic. If you are wondering how to get images for your blog, please read this tutorial: How to upload images and get the url of your pics.

How To SEO Optimize Your Blogger Blog Titles For Higher Search Results

This is called "Blogger/blogspot Title Swapping". Swapping blog's title can help boost your position in search engine results page listing and increase click-throughs as well. From an SEO (Search Engine Optimization) perspective, page title is the most important element in your blog in terms of ranking well in search engines. If you look at your browser's title bar you will notice that Blogger's default templates display your blog title in front of each page or post title.

So page title would normally be displayed as:


search results, blogger seo, seo

After swapping the blog title, it will be appearing like this:

seo optimization, title swapping, blogger optimize

This kind of placement will also appear in google search results. The reason why you should put post titles at the beginning is because users are more likely to search for specific post content rather than the actual name of your blog. So having the post titles at the beginning increases your chances of being found.

How to SEO optimize Blogger post titles

Step 1. Log in to your Blogger Dashboard and go to "Template" > "Edit HTML".


Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the Blogger' search box

Step 3. Type or paste the code below inside the search box to find it:
<title><data:blog.pageTitle/></title>



Step 4. You need to replace the code above with this one:
<b:if cond='data:blog.pageType == "item"'>
<title><data:blog.pageName/> | <data:blog.title/></title>
<b:else/>
<title><data:blog.pageTitle/></title> </b:if>
Step 5. Click the "Save Template" button and you're done.

So this is one of the easiest ways to SEO optimize our Blogger blog titles for higher search results. However, it's not enough to SEO optimize blog title and you have better changes to rank well if you know how to choose the right SEO keywords.

Thursday, March 22, 2012

How To Remove Blogger Attribution Gadget

The Attribution gadget is the gadget in the footer that says "Powered By Blogger". If you have tried to remove this then you may of noticed this gadget is locked into you blog. To unlock it, follow the next steps:

blogger attribution, blogger hacks, powered by
Step 1. Log in to your Dashboard, go to Template > Edit HTML

blogger tricks, blogger hacks,

Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the Blogger' search box

Step 3. Type or paste the following tag inside the search box then hit Enter to find it:
</head>
Step 4. Just above the </head> tag, add this CSS code:
<style>#Attribution1{display: none;}</style>
Step 5. Click on the "Save Template" button to save the changes.

And this is how you can remove the blogger attribution gadget.

How to add a gadget/widget inside your Blogger Blog header

Some of you might have noticed this kind of placement of AdSense Units or other ads and widgets in the header section of the blog, one of the most popular format being the AdSense 468x60 ad unit.

Unfortunately, we are not always able to add widget inside the Blogger header as a Blogspot user. If we are using the Blogger's default template, or any other customized template available on the internet, the header usually is locked and have no option to Add a gadget inside it or next to the blog title.

The reason why some bloggers are using AdSense ads or different widgets in a blog header is because of its maximum of number of impressions. For instance, when a visitor goes to a page, this will be the first place where he would give a first look and this makes it one of the hottest spots in our blog.

gadget inside blogger header


But how we can add a gadget inside Blogger header - be it a AdSense unit, a search bar, social sharing buttons, or a widget? By simply adding a section in the blog's header. First off, to give space for the extra gadget to fit in, our blogger header should be resized.

Important!

Before anything, please make a backup of your current Blogger template so that anything goes wrong, you can easily restore the original working template.

To make a back-up, go to "Template" and look for the "Backup/Restore" button on the upper right side. Clicking on this button will prompt you to save your existing template as an XML file to your hard drive. You can change the name of the file and choose the location to ensure it is easy to find if you need to use this later.

Resize Blogger header

Step 1. Go to Blogger Dashboard, click on "Template" and hit the "Edit HTML" button.

Step 2. Click anywhere inside the code area and open the search box by using the CTRL + F keys:

adsense, blogger tricks, blogger widgets

Step 3. Add this HTML code inside the search box, then hit Enter to find it:
<b:section class='header' id='header' maxwidgets=
Note: If you can't find it, make sure that you have no blank space at the beginning of the line.

Step 4. Replace class='header' with class='header header-left'.

Step 5. Now we need to find the following line of code:
<div class='header-cap-bottom cap-bottom'>
And just above this line, we should see two div tags:
</div>
</div>
<div class='header-cap-bottom cap-bottom'>
Note: if you have a custom Blogger template, you may not find the codes above and instead see the </b:section> tag right after the code from step 3. In this case, you need to add the codes from step 6 and 7 right after the </b:section> tag.

Step 6. Paste the HTML code below just ABOVE these two div tags:
<div style='clear:both;'/>

Now, let's go one step forward and add an extra gadget section within our Blogger header!

Add a new gadget/widget element to the Blogger Header

Step 7. Just above <div style='clear:both;'/> (step 6)... add this code:
<b:section class='header-right crosscol' id='header-right' maxwidgets='1' showaddelement='yes'/>
Step 8. Now find this tag:
</head>

Step 9. Just above the </head> tag, add this CSS code:
<style>
.header-left{
display: inline-block;
float: left;
}
#header-right {
display:inline-block;
float:right;
}
</style>
Note: if your widget is wider than overall area that both elements should occupy, then you might need to add the margin-right property to move it more on the right - see this example:
<style>
.header-left{
display: inline-block;
float: left;
}
#header-right {
display:inline-block;
float:right;
margin-right: -20px;
}
</style>
Step 10. Press the "Save Template" button to save the changes.

Step 11. Now go to "Layout" of your blogger blog and you should see two gadgets on the header area.

Don't worry if the "Add a Gadget" element doesn't appear side by side as every blogger template is different. They might be slightly up or down or sometimes they might overlap each other. Just make sure that you drag the newly created widget just below the "Header" section.

widgets for blogger, blogger tricks

As I said before, the header section could be one of the most valuable places in a blog. In that gadget/widget you can add anything like AdSense ads, search boxes, social sharing buttons, or you could, as well, sell that space for advertisement to boost your income.

Monday, March 19, 2012

How to Burn Blogger RSS Feeds at Feedburner

What is RSS?

A RSS (Really Simple Syndication) feed is a XML-based format for your content. Most blogging platforms, for example, will have an RSS feed built in. Whenever you start publishing posts, your latest posts will be updated in the RSS feed. Visitors on your website can subscribe to your blog’s RSS feed in an RSS reader such as Google Reader.

What is FeedBurner?

Most blogs have RSS feed which is detected automatically by commonly used feed readers when the blog URL is added to the reader. However, if you want to make it more obvious and easier for readers to subscribe using RSS, or want to know exactly how many people subscribe to your blog, then the best option is to add a FeedBurner RSS feed and email subscription to your blog.

Feedburner is a free web service which enhances bloggers' and podcasters' ability to manage their RSS feeds and track usage of their subscribers.


How to create a feed with Feedburner

1. Go to FeedBurner and sign in to Feedburner with your Google Account (create a Google Account first if you don't have one).

2. To set up your RSS feed with FeedBurner, simply copy the URL of your RSS feed and paste it into the “Burn a feed right this instant” box. Then click Next >>


3. On the next screen, choose the second options - RSS.


4. Now you will be given your RSS feed's new URL on FeedBurner. You will want to use this URL anywhere you reference your RSS feed on your blog. Change the feed title and URL with your own.


5. Click on Next and you will see the options to setup tracking features for your RSS feed. Check "Clickthroughs" and "I want more!..." options.


Adding Your FeedBurner Feed To Your Blog

This is used to add the RSS icon and subscribe options to your blog sidebar using a text widget as explained below:
1. Click on the "Publicize" Tab > "Chicklet Chooser" in your FeedBurner account and copy the HTML code.

2. Go to Blogger Dashboard > Layout > look for the Page Elements on the right side and "Add a Gadget".

3. Select HTML/JavaScript from the pop-up window and paste the HTML code in the box.

Adding a FeedBurner Email Subscription

After you have set up your feed, you will want to consider giving visitors the option to subscribe to your content via email. If so, go to the "Publicize" tab and click on "Email Subscriptions". Finally, click on the "Activate" button to start email subscription service for your RSS feed.


You will then want to click on "Communication Preferences" in the left sidebar menu. This will allow you to customize the activation email subscribers receive to confirm their subscription.



Once customized, click "Save". The next options to configure are under "Email Branding" in the left sidebar menu where you can upload a logo, customize the Email Subject line and change the font styles, colours, and sizes to format the email subscribers will receive. Click "Save" when finished.

The last (and most important) setting for your email subscription is the "Delivery Options". This is where you will tell FeedBurner when to deliver new RSS feed updates to subscribers.

Once saved, click on the "Subscription Management" link. Here, you can get the code to add a subscription form on your blog or you can get a link to your take visitors to the opt-in form for subscribing via email.


To add it on your blog, log into your Blogger account, then go to Layout and look for the Page Elements on the right side. Click on the "Add a Gadget" link and once the pop-up window appears, select "HTML/JavaScript" option. Paste the code in the empty 'Content' box.

Redirecting All Your Blog Feed To FeedBurner

Unless you redirect all your blog feed to FeedBurner you won't get accurate subscriber numbers because some of your readers subscribe using your original blog feed.

To do this, go to "Settings" > "Site Feed" and add your FeedBurner URL to "Post Feed Redirect URL". Then, Save Changes.


Now all your feeds are automatically redirected through FeedBurner and you'll be able to track subscribers.

That's it! If you found this tutorial useful, please subscribe to our RSS feed.

Saturday, March 17, 2012

Add Facebook Like Button Below Post Titles

The Facebook Like button will allow visitors to Like your post and share it with their Facebook friends. In this tutorial, we will see how we can add a Like button for each individual Blogger post, and not a Facebook fan box for the entire blog (which is also a good idea to have it in the blog's sidebar). Having a Facebook Like button below your post titles makes easier for Facebook users to like specific posts on your blog, which in turn displays the liked content on their profile (and potentially on their friend's feeds).

If you want to add the Facebook Like Button below your blogger post title, then follow these steps:

Adding Facebook Like Button Below Post Titles

facebook like button, blogger tricks
Step 1. Go to Blogger Dashboard > Template > Edit HTML 

facebook for blogger, facebook button

Step 2. Click anywhere inside the code area and search using CTRL + F keys for this tag (hit Enter to find it):
<data:post.body/>
Note: you may find it more than 3 times, stop at the second one (or third one in case it won't show up after applying the code on the next step).

Step 3. Just above it, copy and paste the following iFrame code:
<p><iframe allowTransparency='true' expr:src='&quot;http://www.facebook.com/plugins/like.php?href=&quot; + data:post.url + &quot;&amp;layout=button_count&amp;show_faces=false&amp;width=100&amp; action=like&amp;font=arial&amp;colorscheme=light&quot;' frameborder='0' scrolling='no' style='border:none; overflow:hidden; width:100px; height:20px;'/></p>
facebook button

Step 4. Save your template and you are done adding the Facebook Like button below you Blogger post titles.

Auto Read More with thumbnail for Blogger/Blogspot Posts

How to make posts in the blog homepage to be displayed with an automatic "read more" button and a thumbnail.

To be more specific, this will show the title of the post, a short summary with a number of characters and a thumbnail, that will be the thumbnail of the first image uploaded inside the post. After the thumbnail and the post summary, there will be a "Read More" link which, when you click on it, will take you to the actual post.

This Automatic Read More script will summarize content and the post summary will be shown only on the main blog page (homepage), category pages, and archive pages.

Using the Automatic Read More feature in Blogger Posts

Step 1. From your Blogger dashboard, go to "Template" and click on the "Edit HTML" button:


Step 2. Click anywhere inside the code area, then press the CTRL + F keys and search for this tag (hit Enter to find it):
<data:post.body/>
Note: after hitting Enter, you'll find this code more than once but you need to stop at the third one.

Step 3. Replace the code above with this one:
<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<div expr:id='&quot;summary&quot; + data:post.id'><data:post.body/></div>
<script type='text/javascript'>createSummaryAndThumb(&quot;summary<data:post.id/>&quot;,&quot;<data:post.url/>&quot;,&quot;<data:post.title/>&quot;);</script>
 <span class='readmore' style='float:right;'><a expr:href='data:post.url'>Read More &#187;</a></span></b:if></b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'><data:post.body/></b:if>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'><data:post.body/></b:if>
Note: if you don't see any changes after going through all the steps, please try to replace the second <data:post.body/> as well.

Step 4. Now search for the following tag:
</head>
Step 5. Just above the </head> tag, add the following script and CSS code:
<script type='text/javascript'>
posts_no_thumb_sum = 490;
posts_thumb_sum = 400;
img_thumb_height = 160;
img_thumb_width = 180;
</script>
<script type='text/javascript'>
//<![CDATA[
function removeHtmlTag(strx,chop){
if(strx.indexOf("<")!=-1)
{
var s = strx.split("<");
for(var i=0;i<s.length;i++){
if(s[i].indexOf(">")!=-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, pURL, pTITLE){
var div = document.getElementById(pID);
var imgtag = "";
var img = div.getElementsByTagName("img");
var summ = posts_no_thumb_sum;
if(img.length>=1) {
imgtag = '<span class="posts-thumb" style="float:left; margin-right: 10px;"><a href="'+ pURL +'" title="'+ pTITLE+'"><img src="'+img[0].src+'" width="'+img_thumb_width+'px" height="'+img_thumb_height+'px" /></a></span>';
summ = posts_thumb_sum;
}

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

<b:if cond='data:blog.pageType != &quot;static_page&quot;'>
<b:if cond='data:blog.pageType != &quot;item&quot;'>
<style type='text/css'>
.post-footer {display: none;}
.post {margin-bottom: 10px; border-bottom: 1px dotted #E6E6E6; padding-bottom: 20px;}
 .readmore a {text-decoration: none; }
</style>
</b:if>
</b:if>
Note: 
- To change the number of characters shown when there is no thumbnail, modify the 490 value in blue. For the number of characters shown when a post has a thumbnail, modify the 400 value.
- If you want larger thumbnails, modify the 160 (height) and 180 (width) values in red.

Step 6. Click on the "Save template" button to save the changes.

And this is how you can add auto read more with thumbnail to Blogger posts. Enjoy!

Friday, March 16, 2012

Adsense Ad Code Converter

HTML has special handling for characters like < and > symbols, so it doesn't work well with those characters where they shouldn't be.

Having spurious characters like those symbols in your text can have some weird effects - blocks of text not appearing, broken formatting, and generally just not seeing what you expect to see.

This can all be fixed by 'escaping' those characters. This process involves scanning the text for those characters, and replacing them with a special character-code that browsers can interpret as the correct symbol, without actually embedding that symbol in your text.

For example, the escaped character code for > is &gt;.

This tool automatically converts a JavaScript ad code into the correct format so you can embed it directly into your new xml Blogger template. It’s perfect for converting AdSense, AdBrite, Chitika or any other JavaScript code that you may have.

paste code

How to Use the AdSense Code Converter

Paste your AdSense code or any HTML in the empty box and then press the Convert button.

How to put Adsense ads on Blogger/Blogspot

If you want to earn money from your site or blog, Google Adsense is the most popular service to monetize your website content. When implemented, AdSense will display targeted Google ads on your blog and they can generate revenue on either a per-click or per-impression basis.

In order to display ads on your site, you should first Sign Up to Google AdSense program. Before adding your ads, keep in mind that AdSense allows only up to 3 ad units, 3 link units and 2 search boxes per page.

This tutorial will show you three ways to add AdSense ads on your Blogger blog.

1. Add AdSense Gadget

Use this method to add ad unit as a widget in places that are outside the content or blog post area. You can position it by simply dragging it in Page Elements, just like with any other widget. To add the AdSense Gadget, follow these steps:

Step 1. Log in to your Blogger Dashboard, go to "Layout" and click on the "Add a Gadget" link on the Page elements area.

blogger layout, add a gadget

Step 2. From the pop-up window, select the "AdSense" Gadget

adsense gadget, blogger widgets

Step 3. Configure the ad format and colors - see the screenshot for more details:

adsense format, adsense blogger

Step 4. Finally, click on the "Save" button and you're done.

2. Display Inline Ads

This will display an ad unit at the end of each post. To show ads between posts:

Step 1. Go to "Layout" and on the Page Elements area, click the "Edit" link on the "Blog Posts" gadget.

blogger posts, blogger layout

Step 2. Check the "Show Ads Between Posts" box.

show ads in blogger

Step 3. Configure ad frequency, ad format and colors. Live preview is provided beneath the settings.

Step 4. Click on the Save button to save the settings.

3. Using AdSense code

The most notable benefits of using this method are:
  • You can place ad anywhere in your blog
  • You can add the code anywhere in your blog template - in your post content or page.
  • To find out which format perform the best, custom channels will help you to track the performance of specific groups of ad units.
  • You can choose types other than ad unit i.e. link unit, search box.
To create an ad unit:

Step 1. Go to Google AdSense website.
Step 2. Click on "My ads" tab, go to "Ad units" and then click on the "New ad unit" button.


Step 3. Choose your ad type, choose format and colors and assign channels.
Step 4. When you have finished editing, click on the "Save and get code" button and copy the code provided.

To add an ad unit to your blog, you have the following options:
  • Paste the code in a HTML/JavaScript gadget
  • Paste the code in the blog post or page HTML section, or
  • Paste the code direct in your template. (if you choose this option, first you should convert AdSense ad code)
If you have any more questions, leave a comment below.

Monday, March 12, 2012

How To Remove Blogger Threaded Comments

The Blogger Threaded commenting system allows a reader to reply to other reader comments on that post. Blogger supports threaded commenting with two levels - the original comment, and the replies to that comment. If you want remove threaded comments from your blogger blog, follow these steps:

Important

Before anything, it is recommended to backup your Blogger template so that if anything goes wrong, we can easily restore the original working template on our blog.

To make a backup of your current Blogger template, go to your Blogger dashboard, then go to "Template" and click on the "Backup/Restore" button on the upper right side. Clicking on this button, will prompt you to save your existing template as an XML file to your hard drive. You can change the name of the file and choose the location to ensure it is easy to find if you need to use this later.

Removing the Blogger Threaded Comments (with reply option)

Step 1.Go to "Template" and click on the "Edit HTML" button

blogger template edit html

Step 2. Click anywhere inside the code area and press CTRL + F keys to open the Blogger' search box.


Step 3. Paste or type the first line of the following code inside the search box and hit Enter in order to find it:
<b:if cond='data:post.showThreadedComments'>
            <b:include data='post' name='threaded_comments'/>
          <b:else/>
            <b:include data='post' name='comments'/>
          </b:if>
        </b:if>
        <b:if cond='data:blog.pageType == &quot;item&quot;'>
          <b:if cond='data:post.showThreadedComments'>
            <b:include data='post' name='threaded_comments'/>
          <b:else/>
            <b:include data='post' name='comments'/>
          </b:if>
        </b:if>
Step 4. Remove this code (you will find it twice, so you need to replace it twice) and paste the below code instead:
   <b:include data='post' name='comments'/>
          </b:if>
               <b:if cond='data:blog.pageType == &quot;item&quot;'>
                     <b:include data='post' name='comments'/>
     
        </b:if>

Step 5. Save the changes by clicking on the "Save template" button.

That's it!

Search This Blog

Recent Post

Recent Posts Widget

Blog Archive