Adding a Breadcrumb to your Blog | Breadcrumb for Blogger

Breadcrumbs are the line of texts that show the path of the article or page they are currently in. By using breadcrumbs user can navigate your site with ease. Breadcrumbs would help you find where you are in a website. In other words, they keep track of your navigation throughout the website or blog. The breadcrumb can be seen on our site too in the top and it looks like this:

So you come to know what a breadcrumb means. Is it cool enough to have one on your website or blog? Follow my instructions to install a breadcrumb on your blog too.

Installation Procedure:

Go to Template > Edit HTML
Ctrl+F to find the following code
<b:include name="status-message" data="top" />

and paste the following code immediately after the above line
<b:include data='posts' name='breadcrumb'/>

Now find the following code
<b:includable id='main' var='top'>

Paste the following code right before the code above
<b:includable id='breadcrumb' var='posts'> <b:if cond='data:blog.homepageUrl != data:blog.url'> <b:if cond='data:blog.pageType == "static_page"'> <div class='breadcrumbs'><span><a expr:href='data:blog.homepageUrl' rel='tag'>Home</a></span> » <span><data:blog.pageName/></span></div> <b:else/> <b:if cond='data:blog.pageType == "item"'> <!-- breadcrumb for the post page --> <b:loop values='data:posts' var='post'> <b:if cond='data:post.labels'> <div class='breadcrumbs' xmlns:v=""> <span typeof="v:Breadcrumb"><a expr:href='data:blog.homepageUrl' rel="v:url" property="v:title">Home</a></span> <b:loop values='data:post.labels' var='label'> <b:if cond='data:label.isLast == "true"'> » <span typeof="v:Breadcrumb"><a expr:href='data:label.url' rel="v:url" property="v:title"><></a></span> </b:if> </b:loop> » <span><data:post.title/></span> </div> <b:else/> <div class='breadcrumbs'><span><a expr:href='data:blog.homepageUrl' rel='tag'>Home</a></span> » <span>Unlabelled</span> » <span><data:post.title/></span></div> </b:if> </b:loop> <b:else/> <b:if cond='data:blog.pageType == "archive"'> <!-- breadcrumb for the label archive page and search pages.. --> <div class='breadcrumbs'> <span><a expr:href='data:blog.homepageUrl'>Home</a></span> » <span>Archives for <data:blog.pageName/></span> </div> <b:else/> <b:if cond='data:blog.pageType == "index"'> <div class='breadcrumbs'> <b:if cond='data:blog.pageName == ""'> <span><a expr:href='data:blog.homepageUrl'>Home</a></span> » <span>All posts</span> <b:else/> <span><a expr:href='data:blog.homepageUrl'>Home</a></span> » <span>Posts filed under <data:blog.pageName/></span> </b:if> </div> </b:if> </b:if> </b:if> </b:if> </b:if> </b:includable>

The above code displays label of the current post in the breadcrumbs.

Add this following CSS code before ]]></b:skin>
.breadcrumbs { padding:5px 5px 5px 0px; margin: 0px 0px 15px 0px; font-size:95%; line-height: 1.4em; border-bottom:3px double #e6e4e3; }

Now Save your template and check for breadcrumb in your template. Post a comment if you have any problem in installation of this code in your blog.

0/Post a reply/Replies

Previous Post Next Post