Showing posts with label code. Show all posts
Showing posts with label code. Show all posts

Fix for Responsive Design of Blogger Designer Template

It is very Important to know that Designer templates like Popular "Simple Template", has no Wrapper element in their CSS, so it is futile to look into the solutions offered using them at many places. Also, You won't be able to detect and use css elements via Google Chrome or Mozilla Firefox element inspectors, for what has been rendered. I would discuss important issues only.

Problem with hyperlinks, Landing on different Page Or Home Page

Many bloggers are using mobile template which has in built feature to append the urls with ?m=1, forcing the browser to open mobile version of the page. However, it creates its own problems. Instead of writing ?m=1 at the end of url, it writes something like example.com/?m=1..... resulting into, you being landed upon the Home Page instead of the page you wanted to land on.

To fix it, find this piece of code

if (screen.width <= 699) { document.location = "/?m=1"; }

in your template and replace it with:

if (screen.width <= 699) { document.location = document.URL + '?m=1'; }

Responsive Design without using Mobile Templates:

Many Bloggers have come out with solutions about this issue. Most of them are using wrappers and containers for resizing according to device width. However many templates including this one (Simple), I am using don't have wrappers. Good news is in fact these templates are Responsive by default. You don't need to write many media queries parameters for different width sizes. Just a very simple tweak does the trick. Simply, find the following code in your template:


body {
min-width: $(content.width);
}
.content-outer, .content-fauxcolumn-outer, .region-inner {
min-width: $(content.width)
max-width: $(content.width)
_width: $(content.width)
}

Change it to:

body {
min-width: $(device.width);
}
.content-outer, .content-fauxcolumn-outer, .region-inner {
min-width: $(device.width)
max-width: $(device.width)
_width: $(device.width)

With this simple tweak, you get the Responsive Design which adjusts according to the device width and you don't need to do anything. After doing it, you get the desired dynamic width adjustment and only other thing is to make your other size elements Fluid. Fluid means simply remove static size elements in pixel and start writing in percentage term. (PS: Although it is a good starting point to make your template responsive, keep experimenting till you have fixed every issue with responsiveness).

I've added following piece of code to limit the width of the blog,spreading too far. Just find .content-inner in CSS, and alter it like this:

.content-inner {
padding: 10px;
margin: 0 150px 0 150px;
}

.

Also, add a little piece of code like this one in CSS:

@media all and (max-width: 900px){

.content-inner , .columns {width:100%; margin-left:0 !important;margin-right:0 !important;}
#header-right {float:left}
#crosscol {
width: 80%;
}


Implementing all the above, You would exactly have website like mine. I need to work on Header and footer too. So, it is still not right time for saying Goodbye to the mobile template.

After coding for responsiveness, you may opt out of mobile template version of your blog. You will get a single Responsive Version of CSS which is compatible across every device. Cheers!

Read This >>

Facebook Open Graph Fix- Known Issues Solved !

facebook_open_graph
Facebook Liked Description on Timeline

I had thought of writing on this topic for a long time. However, web is already filled with open graph documentations, so, I would only discuss the troubleshooting part, which you can easily implement, and has not been discussed earlier.

  1. Meta Tag inside body

    Remove all the meta tags inside <body>....</body> in your template. Sometimes, you add them to fix some problems as a short cut method. However, this is a very bad practice. Even, Schema.org documentation recommends adding them in some cases, but, you should preferably avoid adding a meta tag which is something like, <meta...../>, outside </head> of your blog or website.

  2. Website Logo not showing.

    You know facebook requires pictures of high quality, in specified size and formats. However, you can easily avoid all these hassles by simply uploading the Logo as Facebook Fan Page Logo and just right click there, copy the image url and use the URL in open graph, like, <meta content='http://profile.ak.fbcdn.net/hprofile-ak-snc4/276570_154982213146_6949695_q.jpg' property='og:image'/>

  3. Author Description is Weird.

    Here too Author Description for Blog should be like: <meta content='Author Description URL' property='article:author'/>. If you use About page of your blog or website. It will show as Author:About, on facebook, and hover card too would look blank and weird. If you create a page with different title, even then, hover card wouldn't show description. To avoid hassles, here too use the Facebook profile page url, like <meta content='http://www.facebook.com/rameshbook' property='article:author'/>, and everything gets fixed!

  4. Website name not showing in "liked" or "shared".

    You are missing an app id. create a facebook app, and give it your website's name, add the app id meta tag, like, <meta content='your app id' property='fb:app_id'/>, soon the liked article would show, "Liked on Your App Name", like, "liked on Netargument".

  5. Facebook not reading the corrected tags and using the old one.

    It takes time, but you can get it corrected if you want in no time, simply visit this url and put your page url. This will update facebook servers, and your description will start showing according to fresh tags.

Read This >>

Breadcrumb with Navigation for More Pageviews

Breadcrumbs are trails of webpages in a website that you have browsed, shown mostly on the top of the pages for better back and forth navigation.

Breadcrumb_Blogpost_webpage
Breadcrumb with Post Navigation

In blogger we use Labels as Breadcrumb, which though are not true breadcrumb, we just show the crosss linkage of pages across Labels. Since, labels themselves may no be cross linked, it is advised to show only one of them, to avoid any possible penalty.

Here, I would be giving you a code which not only shows breadcrumb on your blog post but also, has an embedded Newer post, older Post Navigation on the top, that sits seamlessly on the top of your blogger post. Check this post for Live Demo, and play with it to learn how it functions.


First, add the following code into the CSS of your blogger template:

.breadcrumbs{border-bottom:1px solid #E7E7E7;
font: 8px "Lucida Sans Unicode","Lucida Grande",sans-serif;}.charfix {
 font-size:130%; line-height:0; } 



Then find the below code in your template,

<b:include data='top' name='status-message'/>

Immediately above that paste this code:

<b:include data='posts' name='breadcrumb'/>

Now Find, the Following code in your template:

<b:includable id='main' var='top'>


There may be two places of the above code. If it occurs once, paste the below code (Modified form of Anish's Code) just above it. If twice, then paste below code above second one:

<b:includable id='breadcrumb' var='posts'>
<b:if cond='data:blog.homepageUrl != data:blog.url'>
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
<div class='breadcrumbs'><span><a expr:href='data:blog.homepageUrl' rel='tag'>Home</a></span> &#187; <span><data:blog.pageName/></span></div>
<b:else/>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
<!-- breadcrumb for the post page -->
<b:loop values='data:posts' var='post'>
<b:if cond='data:post.labels'>
<div style='display:inline'><span class='breadcrumbs' xmlns:v='http://rdf.data-vocabulary.org/#'>
<span typeof='v:Breadcrumb'><a expr:href='data:blog.homepageUrl' property='v:title' rel='v:url'>Home</a></span>
<b:loop values='data:post.labels' var='label'>
<b:if cond='data:label.isLast == &quot;true&quot;'>
 &#187; <span typeof='v:Breadcrumb'><a expr:href='data:label.url' property='v:title' rel='v:url'><data:label.name/></a></span>
</b:if>
</b:loop>
 &#187; <span><data:post.title/></span>
    </span><b:if cond='data:newerPageUrl'><b:if cond='data:olderPageUrl'>
    
      <a class='blog-pager-older-link' expr:href='data:olderPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-older-link&quot;' expr:title='data:olderPageTitle'><span id='blog-pager-older-link'><span class='Charfix'>&#9668;</span>  </span></a>
    
    </b:if>
    
      <a class='blog-pager-newer-link' expr:href='data:newerPageUrl' expr:id='data:widget.instanceId + &quot;_blog-pager-newer-link&quot;' expr:title='data:newerPageTitle'><span id='blog-pager-newer-link' style='float:right'><data:newerPageTitle/><span class='Charfix'>&#9658;</span>  </span> </a>
     </b:if></div>
<b:else/>
<div class='breadcrumbs'><span><a expr:href='data:blog.homepageUrl' rel='tag'>Home</a></span> &#187; <span>Unlabelled</span> &#187; <span><data:post.title/></span></div>
</b:if>
</b:loop>
<b:else/>
<b:if cond='data:blog.pageType == &quot;archive&quot;'>
<!-- breadcrumb for the label archive page and search pages.. -->
<div class='breadcrumbs'>
<span><a expr:href='data:blog.homepageUrl'>Home</a></span> &#187; <span>Archives for <data:blog.pageName/></span>
</div>
<b:else/>
<b:if cond='data:blog.pageType == &quot;index&quot;'>
<div class='breadcrumbs'>
<b:if cond='data:blog.pageName == &quot;&quot;'>
<span><a expr:href='data:blog.homepageUrl'>Home</a></span> &#187; <span>All posts</span>
<b:else/>
<span><a expr:href='data:blog.homepageUrl'>Home</a></span> &#187; <span>Posts filed under <data:blog.pageName/></span>
</b:if>
</div>
</b:if>
</b:if>
</b:if>
</b:if>
</b:if>
</b:includable>

Save it, and again add or overwrite the existing CSS for the New Post, old post link, preferably through Add CSS feature of your blog:

#blog-pager-older-link, #blog-pager-newer-link, #home-link{background:#DDDDDD; border:double;padding:1px;display:inline-block;font-size:9px;}

Save, the template & check, how it looks like on post pages. You will find something like, one shown in the image of this blog.


(Note, This blogpost may not show the Navigation, till it is the newest post. For Checking how it functions and live demo, check an older post)
Read This >>

Simplified Schema formatting of content for Search Rich Snippet & Adwords

Many microdata(microformats), formats like RDFa were brought forth by different sources working in different directions for structuring data on the webpage. Google, Yahoo & MSN came together to formulate a universal categorization language on the web. Their Joint collaboration is schema.org convention of tagging information, which can be easily mastered, applied and understood by Search Engines & webmasters.

RDFa has been a popular way of Data Structuring for a long time now. After the adoption of RDfa open graph by Facebook and RDFa goodrelations for ecommerce, it has become a popular convention. However, with all major search engines announcing the transition towards Schema.org, it is better to talk about schema only.

Schema taxonomy relies on hierarchical structuring of data along the attributes, itemscope, itemtype & itemprop. There are few other attributes which are of lesser importance, like itemid. We shall concentrate on the most important ones only, here.

Itemscope, is the signal to search robots that the container where it is present, contains some data of interest to them which are structured according to the schema.org convention. Like, if the <div itemscope..... is encountered, it expects itemtype data to know what is the subject of the structured data. Whether, it is person, profession, organisation.... Here, comes the role of the attribute itemtype. So, the container div now should give the information about the kind of data expected within it. The attribute itemtype, refers to a particular url for this purpose. If the data contained is of a person, then itemtype should refer to schema.org/Person, if the data is of a professional service. It should refer to schema.org/ProfessionalService. So, our div container may look like,
< div itemscope itemtype="schema.org/Person"
<div itemscope itemtype="schema.org/ProfessionalService"
OR, if I want it to remain composite and split the div into two spans containing, personal and professional informations, then, I would go like this:

<div > <span itemscope itemtype="schema.org/Person"
<span itemprop="....."
<span....... Data about person
........
/span>
<span itemscope itemtype="schema.org/ProfessionalService"
<span itemprop="......"
<span....... Data about Professional Service
/span></div>

The above is a div container that contains both kind of information. Important point here is that, You can write only those values of itemprop, which are present on the itemtype referred schema url. So, just go there and pick them for marking. It is itemprop, which tells search robots, what the container contains. It may be name, nick, job-title, organization.....


So, if I write about myself, the structured data would look like:

<div class="profile"> <span itemscope itemtype="http://schema.org/Person">
<span itemproperty="name"> Ramesh Kumar</span> is a
 <span itemproperty="job-title"
>Google Adwords Qualified Professional</span> 
at <span itemproperty="affiliation">Netargument</span>
</span>.
<span itemscope itemtype="http://schema.org/ProfessionalService">
<span itemproperty="logo"><img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNinMGO7o9iRlFm7p0ZExxC9GpiCPUuRVxyc1owTbC8ADKMBZ20ciPGQcQFK_S8SyCD9JGj0FBvFQ4czCOHKhsEHHqofMs-aOzFyuYbzDJNIjlS_T78dFja_1PzvH_fDGbuOulOy-ZPSQ/s144/logo_qualified_ind_500.jpg"/></span></span></div>

Search Engine will interpret this data as,
Name: Ramesh Kumar, job-title: Google Adwords ...... Working at: Netargument. Logo:  image URL.


job, organization name in rich snippet
Rich Snippet showing Job-title and Org, appearing in Google Custom Search 

Here, if I don't use itemtype="/ProfessionalService", then , I may not have been able to use "logo" attribute and may have been using "photo" as itemprop, which would confuse the bots that the image is my pic. Two spans prevent this situation.


Similarly, you may mark up an offer within a product div, like

<div itemscope itemtype="http://schema.org/Product"><span itemprop="brand">........<span itemprop="offers"></span></span></div> 


The markups are not limited to search snippets only. The new Offer Extension in Adwords too are rumored to work through it.


Warning: Image-url is not a valid itemproperty, Blogger Template Error![Solved]

Please note, blogger's default template contains itemprop="image-url", because of which you may get error in rich snippet tool, wherever you have hyper-linked images. This itemprop value is wrong, you should change all such values to itemprop="image". This will solve the problem.

Note: In the Examples, above, I have broken the divs into span, which is actually an styling element. You can use any element like, <p>, <a> or even nested div, depending on the situation. However, I personally avoid nested divs, because of SEO reasons. 
Read This >>

Internet Explorer, IE9 IE8, XSS, cross site scripting message (error). [Solved] for blogger!

Netargument use Disqus as Commenting system on this blog. In internet explorer browsers, IE8 & IE9, it failed to load with message that Internet Explorer has modified this page to prevent cross-site posting. It display # where disqus is placed and fails to load!

The error is due to Internet Explorer’s XSS filter, which prevents the injected script from accessing information which other website doesn’t intend to allow. However, an application like disqus does the same thing and we want to do it, and IE should understand that it is intended and not a malicious attack!

Microsoft documentation about this XSS filter tells you how to disable it at server level and end user level. End user can disable this by opting out of it in setting, but that is not something which a publisher can force upon them. Those having access to root directory too can disable it by tweaking HTTP header request setting

X-XSS-Protection: 0

Blogger doesn’t offer you access to the root directory, so the solution won’t work for you.

However, we can send request to turn it off through a meta tag. It tells the browser to turn off XSS-filter, and it works!

Just find the below code in your blogger template, going to Edit HTML.

<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible'/>

and change it to:

<meta addname=' X-XSS-Protection:0' content='IE=edge' http-equiv='X-UA-Compatible'/>

This code also changes the compatibility of your website from IE7 to the latest version.

This code will not only solve your website’s cross scripting error, but also make it run smoothly in latest versions of IE.

Read This >>

Blogger AddThis Gadget with Facebook Like & Twitter button positioning!

I was a big fan of ShareThis. For years, it served pretty well on my blog. It offers a bunch of buttons which are very easy to use. Once you paste the Javascript of sharethis in the template, things are very easy to add. It offers definite advantage in terms of customizability and usability, but it has some very serious drawbacks in the long run. It slows down your website through a bunch of tracking cookies. Recently I found whenever the page loads it send call to scorecardresearch.com, which is a third party cookie! Another drawback is, it uses sh.es url shortner for publishing the shared page. It might be a permanent redirect, but I was taken aback when I found pages shared on facebook which displayed netargument.com below the post title, changed to sh.es after sometimes. So, my trust was broken and I completely pulled out all the codes of sharethis from this website. Whenever, installing any third party sharing button one must check: 1) How it impacts speed of your website; 2) The kind of url shortner it uses. Sharethis lost on both!
Addthis is part of Blogger’s gadget library and so you may trust them. They always use your actual url for sharing & if you add it via gadget library, you don’t need to put any Java code in your template, they are taken care of by Google’s server. So you are safe here, from SEO point of view. Links used to be the most important aspect of SEO, but now it is the Speed of your website! Faster and having better on site clickstream data goes higher on Google.
First of all go to gadgets library of blogger and find addthis gadget, by simply going to Page element page. Choose show facebook like and twitter button. If you also want to get rid of Facebook’s Java SDK & Twitter’s Java code from your template, choose none in sharing icon option. They will let you use FB like & tweet button on your website without any need of having codes. If you wish you may even remove twitter and facebook codes to further enhance the performance of your website.
Let us go step by step on How to do it.:
  1. Go to Page element page and click on Add an element
  2. Go to More Gadgets and find Addthis via search there.
  3. Go to next page and check: Show Facebook & Twitter buttons
  4. Next choose “none” from dropdown menu next to Show Icon option.
  5. If you don’t want Add This written on the top of the widget, simply make it blank and Save.

Positioning the buttons

The above steps will add the gadget to the page element box. Now drag the element to just below the Post area. Save arrangement and  click edit once again. Expand the box and note its widget ID, from the top address bar.
Now open the template HTML editor, tick expand the widget option on the top, Ctrl F  to find the widget ID.  Select the line including the widget ID and everything above <b:include name='quickedit'/>. Replace it with the one written below, putting your widget ID at the colored place:

<b:widget id='WRITE YOUR WIDGET ID HERE' locked='false' title='' type='Gadget'>
<b:includable id='main'> 
<b:if cond='data:blog.pageType == &quot;item&quot;'>
  <!-- only display title if it's non-empty -->
  <b:if cond='data:renderingUrl != &quot;&quot;'>
    <b:if cond='data:title != &quot;&quot;'>
      <h2 class='title'><data:title/></h2>
    </b:if>
    <b:if cond='data:gadgetSnippet != &quot;&quot;'>
       <data:gadgetSnippet/>
    <b:else/>
      <div class='widget-content'>
        <b:if cond='data:nonSocialFragment != &quot;&quot;'>
          <data:nonSocialFragment/>
        </b:if>
      </div>
    </b:if>
  <b:else/>
    <data:errorMessage/>
  </b:if></b:if>
Now the buttons will only appear on the blog post page. To further customize it where it should appear on the page. Use the following code, and add it to Add CSS of your blog via Template Designer. The following code will place it at left hand side bottom of the blog post, like the one shown on this page.
#WRITE YOUR WIDGET ID HERE {
position:fixed;
left:0px;
top:625px;
}
If you want to place it near blog post headline, choose this code and adjust the attributes.
#WRITE YOUR WIDGET ID HERE {
position:absolute;
left:  px;
top:  px;
}
If you want to place it near Footer, use this code and adjust the pixel values

#WRITE YOUR WIDGET ID HERE {
position:absolute;
left: px;
bottom: px;
}

For vertical alignment, add:
width:130px;
within the curly bracket in any of the codes.
Read This >>

Warning: Missing required field "updated" in Blogger Rich Snippet Webmaster Tool [Solved]

missing required field updated blogger   Google Search

While testing Rich Snippet for blogger posts in rich snippet testing tool inside Google Webmaster Tools, I found Warning:Missing required field “updated” problem.

A lot of bloggers have advocated deleting hfeed and hentry fields to solve this problem. This indeed solves the problem, however, deleting a field whose function you don’t fully know may become the starting point of the unknown problems. So, I started exploring it further. Blogger gives you by default “published” timestamp field. A simple tweak of this gives the desired solution. Just find the following piece of code:

<a class='timestamp-link' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='published' expr:title='data:post.timestampISO8601'><data:post.timestamp/></abbr></a>

Copy it on a notepad and simply change the class value at two places, like this:
<a class='updated' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='updated' expr:title='data:post.timestampISO8601'><data:post.timestamp/></abbr></a>

Now put the above code inside a div with display setting to none, like this:
<div style='display:none’><a class='updated' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='updated' expr:title='data:post.timestampISO8601'><data:post.timestamp/></abbr></a></div>.

Put the above code anywhere in the body part of the template, maybe just below the “published” field. Save the template and now test again inside the rich snippet tool in Webmaster tools. Warning is Gone!

P.S.----> On 15th of March, 2012, Google updated its Rich snippet guidelines and has mentioned anything inside a “display:none” won’t be considered. So, you should find a place to show it to the readers of the blog too, and remove the <div style=’display:none’> from above including the closing </div> for rich snippet to work properly.

NOTE: – Since, so many people are facing problem implementing it, I am giving you the code which you can simply copy and paste. If you have author & timestamp on the top, use this code in footer just like me and if you have default code in footer, use it on the top below the headline. This code will end all your trouble regarding, rich snippet. Just copy & paste. Wish you good luck!
<a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
                        <span class='post-author vcard' itemprop='name'>
        <b:if cond='data:top.showAuthor'>
          <data:top.authorLabel/>
          <span class='fn'><data:post.author/></span>
        </b:if>
      </span>
                      </a><a class='updated' expr:href='data:post.url' rel='bookmark' title='permanent link'><abbr class='updated' expr:title='data:post.timestampISO8601'> <data:post.timestamp/></abbr></a>

Note 2:--- To determine the position of the code, simply look for <data:post.body/>. This code actually is Your Blog Post. If you post any code above it, it will appear above your blogpost. If you post below it, it will appear below the post body. In addition you have default footer-1, footer-2….. in your template. You may choose any position. Hope this information will help you in determining where to show the “updated field code”. Just keep in mind the aesthetic value of the blog.



Recommended:

  1. Simplified Schema formatting of content for Search Rich Snippet & Adwords
  2. 10 important things to do immediately after starting a BlogSpot blog
  3. 10 Ways to Quickly reduce the Bounce Rate on Landing Page
Read This >>

10 important things to do immediately after starting a BlogSpot blog


10 things that will supercharge your blog. Immediately, after starting your blogspot blog, you require some customization, which gives it professional look and also helps it perform well on search engines.
  1. Remove/Hide the Top Blogger bar.

    Add the Following line of code by going to Edit HTML (Expand Widget):       
    #navbar-iframe{height:0px; visibility:hidden; display:none}
    body{ margin-top:0px;  position:relative;  top:2px}
    which should look like this after adding the code:
    <b:skin><![CDATA[/*
    -----------------------------------------------
    Blogger Template Style
    Name:     Simple
        
    ----------------------------------------------- */
    #navbar-iframe{height:0px; visibility:hidden; display:none}
    body{ margin-top:0px;  position:relative;  top:2px}
  2. Split the Header into two columns

    . Although, blogger has launched many designer templates, none till date, has split header by default. So, you need to insert extra section in Header to get two column headers. Two column header helps you insert extra widget in that area. Find the following code, by going to edit HTML in your blogger control panel, leaving Expand option unticked:                                                                                                  <b:section class='header' id='header' maxwidgets='1'showaddelement='no'>.                      Just after </b:section>, insert the following code:         
    <b:section id='header-right' showaddelement='yes'/>
    <div style='clear: both;'/>                                                 


    Now Find the    ]]></b:skin>    and add the following line of code just before it:
    #header {width:20%;display:inline-block;float:left;}
    #header-right {width:80%;display:inline-block;float:right;padding:0px;}
    #header-right .widget {margin:0;}


    After saving the template, go to add page element, choose the image only option, and insert Logo in Header Left, and description or Adsense in header right column.  Here, for those who have opted for image only option in Header, need to tweak the template again. So, go back to edit HTML, and, find below code: 



    <!--Show the image only-->
          <div id='header-inner'>
            <a expr:href='data:blog.homepageUrl' style='display: block'>
              <img expr:alt='data:title' expr:height='data:height' expr:id='data:widget.instanceId + &quot;_headerimg&quot;' expr:src='data:sourceUrl' expr:width='data:width' style='display: block'/>
            </a>      Replace this code with one given below:

    <!--Show the image only-->
          <div id='header-inner'>
            <a expr:href='data:blog.homepageUrl' style='display: block'>
              <img expr:alt='data:title' expr:height='data:height' expr:id='data:widget.instanceId + &quot;_headerimg&quot;' expr:src='data:sourceUrl' expr:width='data:width' style='display: block'/>
            </a><div class='titlewrapper' style='display:none'>
            <h1 class='title'>
              <b:include name='title'/>
            </h1>
          </div> 
  3. Change Post Title tag to write search engine friendly headlines

    .
    Blogger, by default has Blog Title, into header description. it reduces the real estate of first 150 characters, which are of so importance these days. Your important, headlines goes with blog title to all important services updates, including your posts’ Search engine description.  Just go to Edit HTML, and find <data:blog.pageTitle/>. Replace it with the following line of code: <b:if cond='data:blog.pageType == &quot;index&quot;'>
    <title><data:blog.title/></title>
    <b:else/>
    <title><data:blog.pageName/></title>
    </b:if>
  4. Show more posts on home page. SEO the archives


    Read this/Expand the post feature also, indexes your archived pages by April, May, June… Which helps Search engines to index it in this way. To automatically get the post thumbnails on your home page, copy & paste the following code, just after the </head> tag in your template:                                                                                                          <script type='text/javascript'>
    var thumbnail_mode = &quot;yes&quot;; //yes -with thumbnail, no -no thumbnail
    summary_noimg = 430; //summary length when no image
    summary_img = 340; //summary length when with image
    img_thumb_height = 125;
    img_thumb_width = 150;
    </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){
        var div = document.getElementById(pID);
        var imgtag = "";
        var img = div.getElementsByTagName("img");
        var summ = summary_noimg;
            if(thumbnail_mode == "yes") {
        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 align=justify>' + removeHtmlTag(div.innerHTML,summ) + '</div>';
        div.innerHTML = summary;
    }
    //]]>
    </script>                                                                                                     After this save the template, tick the expand widget option and find <data:post.body/>, in your template. Replace this line with the following code:                               <!—Netargument.com Read This code Start --><b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <data:post.body/><b:else/>
    <div expr:id='&quot;summary&quot; + data:post.id'>
    <data:post.body/>
    </div><script type='text/javascript'>
    createSummaryAndThumb(&quot;summary<data:post.id/>&quot;);</script>
    <div style='clear: both;'/>
    <span class='rmlink' style='float:right;padding-top:5px;'><a expr:href='data:post.url'><b>Read This &gt;&gt;</b></a></span></b:if></b:if>                                                 <!—Netargument.com Read This code End –>                                                                                                          Now, Preview and Save the template. This will create thumbnail of posts on home page, labels and archives. This also helps search engines index your archives by months like March, April…
  5. Insert Meta tags for home page and other pages.


    Use of conditional tags to help the search engines, index the pages, and prevent content duplicate listings. To help search engines index your blog by proper keywords and descriptions, you should write meta tags for home page. Just copy the meta tags from below, alter it suitably and paste after <head> in your template:                                                                                                   <b:if cond='data:blog.url == data:blog.homepageUrl'>
    <meta content=' DESCRIBE YOUR BLOG HERE AS YOU WANT TO APPEAR ON SEARCH PAGES ' name='description'/></b:if>
    <meta content='WRITE 8-10 KEYWORDS HERE RELEVANT TO YOUR BLOG' name='keywords'/>                                                                                       If you want to write Description for other pages too, simply add this code:                                                                                                           <b:if cond='data:blog.url == &quot;WRITE YOUR POST/PAGE URL HEREquot;'><meta content='DESCRIBE THE CONTENT OF THE PAGE' name='description'/></b:if>
  6. Change default comment permalink.


    Blogger default comment permalink adds “?’ attribute to the page url with comment id in post url. Google will then see as an issue of duplicate title tag. To avoid this, you need to change the ‘?’ attribute to “#”. This can be achieved by replacing the default code which is like this: <a expr:href='&quot;#comment-&quot; + data:comment.id' title='comment permalink'> <data:comment.timestamp/>                                                                                                                                               to this one:             <b:if cond='data:post.commentPagingRequired'>


      <a expr:href='data:comment.url' title='comment permalink'> <data.comment.timestamp/> </a>


    <b:else/>


      <a expr:href='data:blog.url + &quot;#&quot; + data:comment.anchorName' title='comment permalink'> <data:comment.timestamp/> </a>


    </b:if>
  7. Bottom Page number for posts, archives and labels.


    Insert the code  just before </b:skin> in your template:                                                                                                         .showpageNum a {
    text-decoration:none;
    border: 1px solid #ccc;
    margin:0 3px;
    padding:3px;
    }
    .showpageNum a:hover {
    border: 1px solid #ccc;
    background-color:#ccc;
    }
    .showpagePoint {
    color:#333;
    text-decoration:none;
    border: 1px solid #ccc;
    background: #ccc;
    margin:0 3px;
    padding:3px;
    }
    .showpageOf {
    text-decoration:none;
    padding:3px;
    margin: 0 3px 0 0;
    }
    .showpage a {
    text-decoration:none;
    border: 1px solid #ccc;
    padding:3px;
    }
    .showpage a:hover {
    text-decoration:none;
    }
    .showpageNum a:link,.showpage a:link {
    text-decoration:none;
    color:#333;
    }                                                                                                                 Save the template, return again to Edit HTML, and leave the Expand widget unticked. Press ctrlF and find Blog1. This should take you to following line of code:                                                                   <b:widget id='Blog1' locked='false' title='Blog Posts' type='Blog'/>
    <b:widget id='HTML12' locked='false' title='' type='HTML'/>
    <b:widget id='HTML2' locked='false' title='' type='HTML'/>
    </b:section>                                                                                                                  Immediately after </b:section>, add the following line of code:                                                                                                            &lt;script type=&quot;text/javascript&quot;&gt;  function showpageCount(json) {
    var thisUrl = location.href;
    var htmlMap = new Array();
    var isFirstPage = thisUrl.substring(thisUrl.length-5,thisUrl.length)==&quot;.com/&quot;;
    var isLablePage = thisUrl.indexOf(&quot;/search/label/&quot;)!=-1;
    var isPage = thisUrl.indexOf(&quot;/search?updated&quot;)!=-1;
    var thisLable = isLablePage ? thisUrl.substr(thisUrl.indexOf(&quot;/search/label/&quot;)+14,thisUrl.length) : &quot;&quot;;
    thisLable = thisLable.indexOf(&quot;?&quot;)!=-1 ? thisLable.substr(0,thisLable.indexOf(&quot;?&quot;)) : thisLable;
    var thisNum = 1;
    var postNum=1;
    var itemCount = 0;
    var fFlag = 0;
    var eFlag = 0;
    var html= &#39;&#39;;
    var upPageHtml =&#39;&#39;;
    var downPageHtml =&#39;&#39;; var pageCount = 14;
    var displayPageNum = 10;
    var upPageWord = &#39;Previous&#39;;
    var downPageWord = &#39;Next&#39;;var labelHtml = &#39;&lt;span class=&quot;showpageNum&quot;&gt;&lt;a href=&quot;/search/label/&#39;+thisLable+&#39;?&amp;max-results=&#39;+pageCount+&#39;&quot;&gt;&#39;;for(var i=0, post; post = json.feed.entry[i]; i++) {
    var timestamp = post.published.$t.substr(0,10);
    var title = post.title.$t;
    if(isLablePage){
    if(title!=&#39;&#39;){
    if(post.category){
    for(var c=0, post_category; post_category = post.category[c]; c++) {
    if(encodeURIComponent(post_category.term)==thisLable){
    if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){
    if(thisUrl.indexOf(timestamp)!=-1 ){
    thisNum = postNum;
    }postNum++;
    htmlMap[htmlMap.length] = &#39;/search/label/&#39;+thisLable+&#39;?updated-max=&#39;+timestamp+&#39;T00%3A00%3A00%2B08%3A00&amp;max-results=&#39;+pageCount;
    }
    }
    }
    }//end if(post.category){itemCount++;
    }}else{
    if(title!=&#39;&#39;){
    if(itemCount==0 || (itemCount % pageCount ==(pageCount-1))){
    if(thisUrl.indexOf(timestamp)!=-1 ){
    thisNum = postNum;
    }if(title!=&#39;&#39;) postNum++;
    htmlMap[htmlMap.length] = &#39;/search?updated-max=&#39;+timestamp+&#39;T00%3A00%3A00%2B08%3A00&amp;max-results=&#39;+pageCount;
    }
    }
    itemCount++;
    }
    } for(var p =0;p&lt; htmlMap.length;p++){
    if(p&gt;=(thisNum-displayPageNum-1) &amp;&amp; p&lt;(thisNum+displayPageNum)){
    if(fFlag ==0 &amp;&amp; p == thisNum-2){
    if(thisNum==2){
    if(isLablePage){
    upPageHtml = labelHtml + upPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;;
    }else{
    upPageHtml = &#39;&lt;span class=&quot;showpage&quot;&gt;&lt;a href=&quot;/&quot;&gt;&#39;+ upPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;;
    }
    }else{
    upPageHtml = &#39;&lt;span class=&quot;showpage&quot;&gt;&lt;a href=&quot;&#39;+htmlMap[p]+&#39;&quot;&gt;&#39;+ upPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;;
    }fFlag++;
    }if(p==(thisNum-1)){
    html += &#39;&lt;span class=&quot;showpagePoint&quot;&gt;&#39;+thisNum+&#39;&lt;/span&gt;&#39;;
    }else{
    if(p==0){
    if(isLablePage){
    html = labelHtml+&#39;1&lt;/a&gt;&lt;/span&gt;&#39;;
    }else{
    html += &#39;&lt;span class=&quot;showpageNum&quot;&gt;&lt;a href=&quot;/&quot;&gt;1&lt;/a&gt;&lt;/span&gt;&#39;;
    }
    }else{
    html += &#39;&lt;span class=&quot;showpageNum&quot;&gt;&lt;a href=&quot;&#39;+htmlMap[p]+&#39;&quot;&gt;&#39;+ (p+1) +&#39;&lt;/a&gt;&lt;/span&gt;&#39;;
    }
    }if(eFlag ==0 &amp;&amp; p == thisNum){
    downPageHtml = &#39;&lt;span class=&quot;showpage&quot;&gt; &lt;a href=&quot;&#39;+htmlMap[p]+&#39;&quot;&gt;&#39;+ downPageWord +&#39;&lt;/a&gt;&lt;/span&gt;&#39;;
    eFlag++;
    }
    }//end if(p&gt;=(thisNum-displayPageNum-1) &amp;&amp; p&lt;(thisNum+displayPageNum)){
    }//end for(var p =0;p&lt; htmlMap.length;p++){if(thisNum&gt;1){
    if(!isLablePage){
    html = &#39;&#39;+upPageHtml+&#39; &#39;+html +&#39; &#39;;
    }else{
    html = &#39;&#39;+upPageHtml+&#39; &#39;+html +&#39; &#39;;
    }
    }html = &#39;&lt;div class=&quot;showpageArea&quot;&gt;&lt;span style=&quot;COLOR: #000;&quot; class=&quot;showpageOf&quot;&gt; Pages (&#39;+(postNum-1)+&#39;)&lt;/span&gt;&#39;+html;if(thisNum&lt;(postNum-1)){
    html += downPageHtml;}if(postNum==1) postNum++;
    html += &#39;&lt;/div&gt;&#39;;if(isPage || isFirstPage || isLablePage){
    var pageArea = document.getElementsByName(&quot;pageArea&quot;);
    var blogPager = document.getElementById(&quot;blog-pager&quot;);if(postNum &lt;= 2){
    html =&#39;&#39;;
    }for(var p =0;p&lt; pageArea.length;p++){
    pageArea[p].innerHTML = html;
    }if(pageArea&amp;&amp;pageArea.length&gt;0){
    html =&#39;&#39;;
    }if(blogPager){
    blogPager.innerHTML = html;
    }
    }}
    &lt;/script&gt;&lt;script src=&quot;/feeds/posts/summary?alt=json-in-script&amp;callback=showpageCount&amp;max-results=99999&quot;; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;                                    Preview the template. This won’t show you any impact, but it’s a safety against any code error. Save it, and you would find the page numbers on home page.
  8. Style/Remove Older Post, Newer Post link


    Following code will add style to the below post older/newer/home link. Just go to Designer>Advanced>Add CSS, and paste this:                                                                                                           #blog-pager-older-link, #blog-pager-newer-link, .home-link{background:#FFF0B7; padding: 5px 5px 5px 5px; }                                                                                                         If you want to completely remove them use this code instead:                                                                                               #blog-pager-older-link, #blog-pager-newer-link, .home-link{background:#FFF0B7; padding: 5px 5px 5px 5px; display:none;} 
  9. Remove Subscribe link below the post body.


    Subscribe link below the post looks ugly and should be removed. Just find the following code:        <b:include name=’feedLinks’/>    in your template, delete and save. It is gone.
  10. Add Favicon:


    Choose a favicon, host it on web preferably in ico/png format(check favicongenerator.com), and paste the following code just before </head> in your template:     <link href='YOUR-FAVICON-URL' rel='shortcut icon'/>
    <link href='YOUR-FAVICON-URL' rel='icon'/>

In addition to all the above I also recommend using an offline Blog Editing software. I myself use and recommend windows live Writer for windows and Blogilo for ubuntu.


Top Resources:
  1. Bloggerbuster.com
  2. Boggersentral.com
Read This >>

fb_xd_fragment, Fix for Blogger powered Blogs & Websites


While going through analytics last year I found a large number of urls with query string ?fb_xd_fragment=. While going to this link in a browser, I found, it displays the page for a while and then it goes white. It has been a big problem for a lot of websites, which uses FB Java SDK for like buttons. Someone, in facebook developers' forum recommended using the following code just before the </body> tag to solve this problem.

<!-- Correct fb_xd_fragment Bug Start -->

<script>

document.getElementsByTagName('html')[0].style.display='block';

</script>

<!-- Correct fb_xd_fragment Bug End -->

This fixed the problem for a long time, till it started once again, when I replaced the like button with, Like+Send button. A large number of pages, in analytics were showing the same query string with same problem. I was losing a big chunk of my traffic. I inspected once again if code installed has got corrupted, and hence pasted it there once again. It produced no impact on how the pages with that query string were served. Google has started indexing the pages with these query strings, and that is what has caused the problem. A blogger has suggested the following fix for this problem, which seems to work in most of the cases.

1/ Change your FB.init to the following

FB.init({appId: appId, status: true, cookie: true, xfbml: true, channelUrl: 'http://example.com/channel.html'});

// ^ channel URL above used to workaround fb_xd_fragment bug

2/ Create the static file for http://example.com/channel.html with the following content:

<script src="http://connect.facebook.net/en_US/all.js"></script>

However, a blogspost blog cannot host a .js file. You need to host it on some other website. The solution is not the best for a blogspot blogger.

Fortunately, a member of Facebook Developer forum has given his own script and it works perfectly for blogger. You just need to paste it after opening <body> tag.

<script>

if(window.document.location.href.match('fb_xd_fragment')!=null)

{

var reg=/\?/

window.document.location.href.match('fb_xd_fragment');

var start=window.document.location.href.search(reg)

window.location=window.document.location.href.substring(0,start);

}

</script>

Some of the templates does not have <body> tag instead a variant is available, you just search for <body, and at the end of this tag paste the code there. It stops the problem immediately.
Also Read:
  1. 10 important things to do immediately after starting a BlogSpot blog
  2. 10 Ways to Quickly reduce the Bounce Rate on Landing Page
  3. Facebook Share - Fshare Workaround for Blogger
Read This >>