This is the third installment in our comprehensive Blogger tutorial series. The previous version of our website was built upon Google’s Blogger platform. While Blogger offers notable advantages in convenience and security, flexibility can occasionally feel constrained. Fortunately, Google grants substantial latitude in layout customization, allowing us to mold our blogs to match our personal design vision.
Below, I have organized, verified, and categorized scattered tips and code snippets for Blogger layout design and web techniques found across the web. I hope this proves helpful! :)
Important Notice Before Editing: Once you modify the template HTML directly, the standard “Edit Content” functionality for “Blog Posts” within the visual “Layout” tab will be disabled. If you require special native settings—such as author location displays—configure them prior to modifying your template (though custom templates may not necessarily support them). Before making any modifications, always back up your template or test changes on a staging blog first.
Random Posts (Displaying Random Blog Articles by Title)
Add an “HTML/JavaScript” gadget in your layout, and paste the following snippet:
<script type="text/javascript"> var randarray = new Array();var l=0;var flag; var numofpost=10;function randomposts(json){ var total = parseInt(json.feed.openSearch$totalResults.$t,10); for(i=0;i < numofpost;){flag=0;randarray.length=numofpost;l=Math.floor(Math.random()*total);for(j in randarray){if(l==randarray[j]){ flag=1;}} if(flag==0&&l!=0){randarray[i++]=l;}}document.write('<ul>'); for(n in randarray){ var p=randarray[n];var entry=json.feed.entry[p-1]; for(k=0; k < entry.link.length; k++){if(entry.link[k].rel=='alternate'){var item = "<li>" + "<a href=" + entry.link[k].href + ">" + entry.title.$t + "</a> </li>"; document.write(item);}} }document.write('</ul>');} </script> <script src="/feeds/posts/default?alt=json-in-script&start-index=1&max-results=1000&callback=randomposts" type="text/javascript"></script>
Facebook Floating Recommendations Bar
To install Facebook’s floating Recommendations Bar (a compact window that automatically slides into view at the bottom left or right corner), insert the relevant implementation inside your template’s HTML editor anywhere within the <body> tag.
In the configuration, X% indicates the percentage of the page scrolled before the bar slides out automatically (e.g., set X to 50). Alternatively, setting this parameter to onvisible triggers the bar as soon as the element containing the fb-recommendations-bar markup scrolls into the active viewport.
Note: Before deploying this snippet, ensure you have initialized the Facebook JavaScript SDK (the top portion provided when generating code from Facebook’s developer portal). I typically install this SDK once inside an HTML/JavaScript widget so it persists across template redesigns.
Floating Social Sharing Bar Fixed to the Post Margin
Navigate to your Blogger dashboard, head to “Layout”, add an “HTML/JavaScript” widget, and insert the code below to render an elegant floating social sharing bar:
Tip: bottom:5% controls vertical positioning on screen, while margin-left:-730px adjusts horizontal alignment relative to your main content container. Feel free to tweak these values to fit your theme’s dimensions.
The snippet below includes buttons for five social networks, which you can adjust or trim as needed:
1. CSS Styling
<style type="text/css">
#pageshare {position:fixed; bottom:5%; margin-left:-730px; float:left; border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;background-color:#fff;padding:0 0 2px 0;z-index:10;}
#pageshare .sbutton {float:right;clear:both;/*bs-fsmsb*/margin:5px 5px 0 5px;}
</style>
2. Widget HTML & Scripts
<div id='pageshare' title="Get this from Vedfolnir">
<div class='sbutton' id='vfacebook' style='margin-left:8px;'>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
</div>
<div class='sbutton' id='gplusone'>
<script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
<g:plusone size="tall"></g:plusone></div>
<div class='sbutton' id='vtwitter'>
<a href="http://twitter.com/share" data-count="vertical" >Tweet</a>
<script src='http://platform.twitter.com/widgets.js' type="text/javascript"></script></div>
<div id="vplurk">
<a href="javascript: void(window.open('http://www.plurk.com/?qualifier=shares&status=' .concat(encodeURIComponent(location.href)) .concat(' ') .concat('(') .concat(encodeURIComponent(document.title)) .concat(')')));"><img src="https://lh4.googleusercontent.com/-jUi5FkX5RBI/UbF5qLrW6pI/AAAAAAAAUf4/sUcTeQb4O1g/s64/plurk_Vedfolnir.com.png" alt="Plurk" /></a></div><!-- Plurk share button -->
<div class='sbutton' id='vstu'><script src="http://www.stumbleupon.com/hostedbadge.php?s=5"></script></div><!-- StumbleUpon share button -->
<div class='sbutton' id='vdigg' style='margin-left:3px;width:48px'> <script src='http://widgets.digg.com/buttons.js' type='text/javascript'></script> <a></a></div> <!-- Digg share button -->
<div style="clear: both;font-size: 5px;text-align:center;">Get <a href="https://www.vedfolnir.com/">ShareThis</a></div></div><!-- floating share bar End -->
Reader Q&A
How to Automatically Embed a Facebook “Like” Button in Every Blogger Post? (Reader Style Rainbow)
Reader Style Rainbow asks:
How can I set up my blog so that a Facebook “Like” button automatically appears on every article? Thank you!
The Fixer’s Response:
On the Blogger (Blogspot) platform, if you want a Facebook Like button or social share bar to appear automatically across all posts, the cleanest and most reliable method is editing your template’s HTML / XML directly:
- Locate the post body tag:
Navigate to Blogger Dashboard > “Theme” / “Template” > “Edit HTML”. Search within the code editor for the core content tag<data:post.body/>(this is Blogger’s core tag responsible for rendering article body content). - Choose button placement:
- At the beginning of the post: Paste your official Facebook Like button code directly above
<data:post.body/>. - At the end of the post (Recommended): Paste the code directly below
<data:post.body/>, allowing readers to like and share effortlessly right after finishing your article.
- At the beginning of the post: Paste your official Facebook Like button code directly above
- Recommended aggregated button solutions:
Beyond embedding standalone Facebook buttons, The Fixer also recommends utilizing multi-platform aggregate toolbars such as AddThis or ShareThis. These not only combine Facebook, Twitter, and other networks in a single responsive widget, but also offer built-in analytics while keeping template maintenance sleek and tidy.
Further Reading
- Blogger / Blogspot Layout Design Tutorial and Web Techniques Compilation (Part 1)
- Blogger / Blogspot Layout Design Tutorial and Web Techniques Compilation (Part 2)
- Blogger / Blogspot Layout Design Tutorial and Web Techniques Compilation (Part 4)
Support Independent Perspectives & In-Depth Insights
Every thoughtful analysis and candid critique comes from our dedication to truth and quality. We choose not to follow sensational algorithms or clickbait headlines.
Sustaining independent research requires reader support. Make a one-time or monthly contribution, securely processed by Google.
Payments secured by Google · Manage or cancel anytime in your Google Account




Comments