Add Happy New Year Message to your Blog 2018

The new year is hours away, why not celebrate the joy of the welcoming the year 2018 with the ones who visits your blog?

Let's put a smile on everyone's faces who visits your blog by wishing them a happy new year when they open your website up for the first time.


We've created a small set of photos that you can add to your Blogger blog using a few lines of HTML, CSS and JavaScript code, no coding knowledge required, you have have to know the basics of editing HTML templates. All you are going to do is basic copying-pasting.




The new year is just hours away so without wasting much time let's get on with the tutorial.

Before we begin, here's a quick demo of what you will be adding: Demo Hosted on JSBin

The code that you need

The new message is basically an image that is shown interactively using JavaScript and the way it is displayed using CSS as well. The entire code here is a mixture of HTML, CSS and JavaScript code.

Copy the code:

<div class="new-year-message" id="stramaxon_new_year_message"></div>
<style>
.new-year-message {
display: none;
opacity: 0;
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
transition: .5s all ease-in-out;
z-index: 99999;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
background-image: url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizdj3FJait56mKMFM_iTeNZYt4jfI4Cqyx9ZG4TtdS16zwaYVyJ96MoIeuuH9Mr5a-DCkabCQUPJPveTIjqfZ6qVrx7E0DMS1kgj0Vwn6lVHZB4ih_REe-icnX6lCPJj-PCTFPy91DjKeA/s1600/happy-new-year-3-t.jpg");
}
</style>

<script>
document.addEventListener("DOMContentLoaded", function(){
var seconds = 5; // Number of seconds you want the message to be visible
var show = true;
var message = document.getElementById("stramaxon_new_year_message");

// Check if the message has been shown before
if ( window.localStorage ) {
if ( !localStorage.getItem("stramaxonNewYearMessage") ) {
show = true;
}
else {
show = false;
}
}

// Show and click to close
if ( show ) {
_fadeIn( message );

setTimeout(function(){
_fadeOut( message );
}, seconds * 1000 );

if ( window.localStorage ) {
localStorage.setItem("stramaxonNewYearMessage", "shown")
}
}
else {
// don't show
}
message.addEventListener("click", function(){
_fadeOut(this);
});
});

function _fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
};

function _fadeIn(el, display){
el.style.opacity = 0;
el.style.display = display || "block";
(function fade() {
var val = parseFloat(el.style.opacity);
if (!((val += .1) > 1)) {
el.style.opacity = val;
requestAnimationFrame(fade);
}
})();
};

</script>

Add it to your blog

After you have copied the entire code, the next step is to add it to your blog to actually display the new year message on your blog. 

The easiest and safest method to add a new block of code on a Blogger blog is to add it using an HTML/JavaScript widget, follow the steps to add one to your blog:
  1. Log-into your Blogger dashboard
  2. On your blog's dashboard, go to the Layout section
  3. In the sidebar or a footer section, you may see "Add a Gadget" link, click open it
  4. In the list of gadgets you will find "HTML/JavaScript" to add it click on the plus icon next to it. 
  5. You will now see a text-box under "Content", this is where you have to paste the copied code. Leave the "Title" field empty since we do not want the widget box to be apparently visible on the blog.


  6. Hit "Save" and that's it. 
You have successfully added the code that was required to add a simple, fade-in fade-out new year message on your blogger blog. 

I want a different image

As promised we will be providing a set of images that you can use depending on your blog's style and your taste. It is fairly easy to change which image you want to show. 

  1. In the code that you pasted in the HTML/JavaScript gadget, find the following line

    background-image: url("https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizdj3FJait56mKMFM_iTeNZYt4jfI4Cqyx9ZG4TtdS16zwaYVyJ96MoIeuuH9Mr5a-DCkabCQUPJPveTIjqfZ6qVrx7E0DMS1kgj0Vwn6lVHZB4ih_REe-icnX6lCPJj-PCTFPy91DjKeA/s1600/happy-new-year-3-t.jpg");

  2. As the name suggests it tells the browser which image to load. The URL inside url() is the link to the image we are using. All you have to do is replace it with the URL of the image you would like to use. 
Here are the links to four different images that we prepared for you to use (right click on the link and copy link address):

Why I don't see it?

If you added the codes properly and you still can't see the message then it can be for two reasons:
  1. Either JavaScript is disabled in your browser. To fix it please look for ways to enable JavaScript in the browser you are using. 
  2. In case you only were able to see it for the first time you loaded your blog and it doesn't show up after that, then it is not a problem, as the message is set to display only once for a person. You do not want to obstruct a reader's experience every time they visit a different page on your blog with the same message banner. If you just want to check how it looks then fire up a Incognito or Private browsing mode in your browser and load the blog. 

That's it. We hope you find this useful and also wish you a very happy new year! 

See you in 2018. 

New Year, A New Beginning for StramaXon and Me

I started this blog back in the year 2011 when I was still a young enthusiast who had a craze for creating, creating just about anything that he found to be useful for people, to share what he knew and to help and connect with people.


Over these years many things changed, the blog itself went through a lot of make-overs. The content however remained pretty much same in nature - to share the knowledge I have with you all.

Starting with Blogger, I stepped into even broader topics, like web design itself though I always wanted this blog to be only about one topic but I soon found out it was neither wise nor good for the blog itself.

Many tutorials were posted on this blog, everything about Blogger. In the past couple of years, I however failed to write much, a lot of things kept me occupied, academic and work related as well as personal reasons.

I was unable to do for most of the part during the last couple of years and that was to write blog posts here. Somewhere during that time I wanted to start writing blogs again but I was too busy on web development / designing work I had forgot what Blogger was (not in its literal sense!), to be able to write about something you had to be consistent in using that, finding out what needed to covered, but I was unable to do so and that resulted in many many months of no blog posts.

Though, that's the story of past, a new year is awaits. We all know new year's resolutions don't turn out to be great as always, though in this case my new resolution is about something that I love - to write blogs and help people, and this is what I am going to do in 2018 and so on.

Most of the subscribers and readers of the blogs came here for Blogger related topics, and I am going to continue with Blogger and I am sure you will also love the content on topics ranging from Blogger to App Development. If you are a reader of this blog you may know that my blog posts even related to coding are very simplified and aimed at non-coders and that's what it is going to be with the new categories on the blog.

I hope you find my blog useful and find something new to learn. A lot of new content is coming and with it a new look for StramaXon!

Wish you all a very happy new year in advance.


Deepak Kamat

Trouble Adding AdSense Code for Page-Level Ads? Learn how to fix it.

In order to add the Page-Level ads functionality from AdSense on your Blogger blog you are required to place a code that AdSense provides which is :

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"/>

Unfortunately if you have tried placing the code in your theme you may have run into this error that states:

Error parsing XML, line n, column n: Attribute name "async" associated with an element type "script" must be followed by the ' = ' character.



That's a bit annoying - What could be going wrong with the code that AdSense (a Google product) has provided is causing error on Blogger (another Google product).

The problem is highlighted in the error message itself "Attribute name "async" associated with an element type "script" must be followed by the ' = ' character."

Attribute name "async" in the code we got must be followed by a '=' character. But the code we got simply has <script async  ... />

So what can be done? Modify the code to be parsed by Blogger's theme parser correctly. Here's the code with a little change, we replaced async with async="async" to make the code a valid XHTML markup.

<script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

Place this code in your Blogger theme code and save. It should work properly now.

Why do we have to use this "hack"?

This shouldn't even be considered as a hack. This is plainly a case where a valud HTML5 markup is not parsed as a valid XML / XHTML markup. 

Yes, our blogs are HTML5 in the end when it gets loaded on a web browser, but the code that runs in the background is XHTML, and the thing with XHTML is that it is very strict about the markup language. In HTML5 you can simply leave out a value from a attribute or leave an HTML element unclosed and it will still work. 

But XHTML won't. What's valid in XHTML is also valid in HTML5, so this don't need to be considered a hack or even a workaround. AdSense provides the code that is totally HTML5 compliant only it didn't anticipate the case where users may want to add the code to XHTML templates.

Will it have any impact on the way this code is supposed to work?

Other than having a few extra characters in the code you had to add, no. This change wouldn't affect anything how AdSense is supposed to work. We just made the code compliant with XHTML to be taken in by Blogger.



Inviting All Friends to Facebook Page at Once JavaScript Snippet

Facebook is a great tool for connecting with the World but one of the problem is that the population on Facebook is very big and so sometimes we feel the need of a "do all" function in most places such as inviting your friends on your new page.

It can be a hefty job clicking on thousands of "Invite" buttons one after one since Facebook doesn't give you an "Invite all" button. Same used to be true for Group requests but fortunately it now does, but as for Facebook page invites you still have to do the manual way.


In this tutorial we will be learning how to invite all friends to page on Facebook automatically. In the past on our blog we posted some similar codes for Facebook but as you know Facebook changes it design and structure so not all the old codes may still work.

This one is latest and is working (created in June 2017).

We will keep this short, there's only two step mainly, copy the code and paste it, but to perform it successfully we have to do more than just that.

Copy the JavaScript Code 


var btns = document.querySelectorAll("button");
var i = 0;

setInterval(function(){
if ( btns[i].textContent == "Invite" ) {
btns[i].click();
console.log( i + " buttons clicked." );
}
i++;
}, 200);

Open Facebook on Desktop in Chrome / Mozilla Firefox or Safari

After you've open the Facebook website, navigate to your page and you will see the section where you can invite your friends from.


Click on "See All Friends" to make sure all your friends are loaded in the invite section so that when we run the code it invites all of them.  

In the browser open JavaScript Console and Paste the Code

Browsers have a JavaScript console where you can run JavaScript code from on the page, to open it on different browsers see the instructions :

  • Google Chrome: CTRL+Shift+J (CMD for Mac) OR Right click on page > Inspect > Console tab
  • Safari: Safari > Preferences, click Advanced, then select “Show Develop menu in menu bar.”. Now in the Safari Develop menu select "Show JavaScript Console"
  • Firefox: CTRL+Shift+J (or CMD+Shift+J on a Mac) ORselect "Browser Console" from the Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on OS X)




Paste the code in the input area in the Console section and then hit enter. 

That's it, the code will start running and will automatically invite all the friends to your Facebook page in no time. 

Does it have a limit?

There's no limit set by the code, it can invite any numbers of people in very less time but Facebook has a limit on how many friends you can invite to a page daily. Once it exceeds you won't be able to invite friends on the same day. 

We respect that and everyone should, Facebook knows that spamming would be a lot easier for people if it doesn't put such restrictions. 

Please do not use the code for spamming purposes, this tutorial is meant for the people who are genuinely inviting their friends on their page. There's no risk of getting blocked by using this method but we cannot be sure if it is abused, the system will detect. 

Why shouldn't I use an extension?

There are many extensions and add-on in browsers that lets you do the same but our recommendation is that you do not use those and the simple reasons are
  1. You never know what the extension might be running in the background
  2. Such extensions are known to go rogue and show pop-up ads in the future
  3. Do you really need to install a forever running extension for a small task ?
Using the codes you know what you are running on your Facebook pages, because running scripts is very sensitive in browsers, scripts can be used to do a lot of harmful stuffs, so always double-check before running any extensions or scripts in your browser. 

I see an error

Don't worry, it happens, even a small typo can lead to an error. If you see any error commend down below with a screenshot so we can jump in to help you in that regard. 


Full Sized Background Image on Blogger with Blur Effect

In this short tutorial you will learn how to add an image as the background of your blog that stretches to all edges thus fills your entire blog's background portion.


Looking to add a nice effect to your blog by using beautiful pictures as background images? It is a great way to personalize a blog, depending on the color scheme of your blog and the feel that you want the blog to have can all be improved by using an image as the full background.



This tutorial will be guiding you through the process of setting a custom full size image on your Blogger blog with a few lines of CSS as well as showing a way to give it a blurred glass effect.

Here's a quick demo of what you are going to have on your blog by following the steps to add the CSS to your blog: Full Page Background Image Blurred Effect using CSS

Uploading the image

Whatever image you are going to use you have to upload it somewhere in its full size first. The best place to upload it is Blogger itself, it gives unlimited photo storage as well as fast servers from Google wouldn't ever slow your blog down. 

  1. Open a draft post in your Blogger dashboard
  2. Upload the image
  3. When the image appears in the post area, right click on it and "Copy image address" or "Copy link address", the option might be different on different browsers.
  4. Paste the copied URL that is the image's address in a Notepad / Textedit app. We may get something like this

    https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyrajfadQBUo8BooKtb2RHwsSG3DsiDCrVtBHEkAVqP6zcdTmtcmXJ3XQiBo1B0WO6AaeyLOljOpRaaaabRAbD4Y0jnfBmq6pY9TZrb9z0v7pIaWucvuvajBbg2KiWedjLR5pDoqAC9xy2/s1600/photo-1434394673726-e8232a5903b4.jpg
  5. Keep it with yourself, we will need this in the next step. 

The CSS Snippet

CSS is what makes it possible for us to add designs to our websites and blog. This one does the job for adding a full screen background.

html, body {
background: url('IMAGE-URL-HERE') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

Copy the CSS code and paste it in another Notepad / Textedit window.

In this code, replace IMAGE-URL-HERE with the image URL we got in the last step.

html, body {
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyrajfadQBUo8BooKtb2RHwsSG3DsiDCrVtBHEkAVqP6zcdTmtcmXJ3XQiBo1B0WO6AaeyLOljOpRaaaabRAbD4Y0jnfBmq6pY9TZrb9z0v7pIaWucvuvajBbg2KiWedjLR5pDoqAC9xy2/s1600/photo-1434394673726-e8232a5903b4.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

I've done it, what now? Now that you have placed your image's URL in the code we are ready to make it appear on the blog. but before that please do take a backup of your existing blog theme.

  1. Log-into your Blogger Dashboard
  2. Go to the Theme   section
  3. Click on "Customize" 
  4. In the Theme Designer go to Advanced > Add CSS
  5. Paste the CSS snippet into the text area on the theme designer page and click on Apply to Blog on the top right
Open your blog to see the updated background image. Right now you wouldn't see the blur effect, we will see how to do that in the next step.

Let's give it a blurred effect


We assume you are still in the Advanced > Add CSS page in the Theme designer from the last step. A small change in the URL of the image is required to get the blurred effect - that is to reduce the size of the image. Yes, the smaller the image the more blurry it will be. So that's our general idea, instead of using a photo editor app to make the original image blurry we use a small version of the original image.

Let's suppose your code is this, the URL of your image is of course different than the one in the following one.

html, body {
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyrajfadQBUo8BooKtb2RHwsSG3DsiDCrVtBHEkAVqP6zcdTmtcmXJ3XQiBo1B0WO6AaeyLOljOpRaaaabRAbD4Y0jnfBmq6pY9TZrb9z0v7pIaWucvuvajBbg2KiWedjLR5pDoqAC9xy2/s1600/photo-1434394673726-e8232a5903b4.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}

In the URL of your image, which may look something similar to this:

https://3.bp.blogspot.com/..............ynOTNfQCKgB/s1600/photo-1434394673726-e8232a5903b4.jpg

Change the number with the s prefixed to it to something smaller.

https://3.bp.blogspot.com/..............ynOTNfQCKgB/s32/photo-1434394673726-e8232a5903b4.jpg

s32 means the CSS code will load a version of the image that is only 32 pixels wide, so when a small image stretches from edge to edge on a screen it becomes blurry and gives the perfect effect we want.

You can change the value to whatever you like to adjust the level of blurriness of your background image. Change that small part in the code and again click on Apply to Blog to update the CSS code and make it go live on your blog.

Help Needed?

On some third-party themes and even the original themes provided by Blogger the code may not work properly due to some other CSS setting that may be overriding it. If you are unable to get it working then please share your blog URL in the comments down below along with the code that you are using as it is. We would be glad to jump in to help.


Full Blog Posts on Notable Theme's Homepage in Blogger Blogs

In the new themes the page break in post editor is just for the name as the themes auto-truncates the posts and shows snippets and a preview thumbnails only on the homepage. Page break / Jump break is good only for feeds now.

There is no setting to make the theme show full posts on the home, index and archive pages and that is why we feel the need of writing this tutorial.


Previously on StramaXon we published a tutorial to show how it was done on Contempo theme, this tutorial will guide you through the steps to achieve the same with Notable theme, so if you are a Notable Theme user in Blogger then follow the steps given below to get your blog posts to show up as full.

Important: As with all of our tutorials where we are supposed to touch the theme code it is highly recommended that you take a backup of your current Blogger theme.

Video walk-through. 

We've prepared a video tutorial of the same so you can watch it and follow the steps with more ease. 

Link to the video tutorial.



Editing the XML / HTML Code in Theme

  1. Open a new tab in the browser and Log-into your Blogger Dashboard
  2. Go to the Theme   section
  3. Click on "Edit HTML"
  4. When the Theme code editor opens, focus into the code editor and hit CTRL + F / CMD + F to open the in-page search
  5. Look for the following line of code|

    <b:include cond='data:this.postDisplay.showSnippet ?: true' data='post' name='postBodySnippet'/>

  6. Upon searching you will get the result like this,



  7.  Copy the following HTML / XML markup

    <b:if cond='data:widget.type != &quot;PopularPosts&quot;'>
    <div class='post-body-container'>
    <b:include data='post' name='postBody'/>
    <div class='post-sidebar invisible'>
    <b:with value='data:widget.instanceId + &quot;-normalpostsidebar-&quot; + data:post.id' var='sharingId'>
    <b:include cond='data:post.shareUrl' data='{ shareButtonClass: &quot;post-share-buttons-top&quot;, overridden: true }' name='maybeAddShareButtons'/>
    </b:with>
    <b:if cond='data:post.labels and !data:post.labels.empty and data:this.allBylineItems.labels'>
    <div class='post-labels-sidebar'>
    <h3><data:messages.labels/></h3>
    <b:include data='post' name='postLabels'/>
    </div>
    </b:if>
    </div>
    </div>
    <b:else/>
    <b:include cond='data:this.postDisplay.showSnippet ?: true' data='post' name='postBodySnippet'/>
    </b:if>

  8. Go back to the theme editor where we previously found the line of code from step 5. Replace that line of code with the code you just copied. This is what it the XML code should look like when you have replaced it.


  9. Now click on "Save theme" to save the changes and go to your blog to see the change. The posts should now appear full on all the pages. 

You may have noticed that the "Read More" button is still there even though the post shows up full, it's because the Jump link is added by another code that we didn't touch yet and it isn't even necessary, we will be using CSS to simply hide the links.

CSS to hide the Jump Link

This CSS snippet should hide the "Read more" links from the posts on home, archive and index pages.
.widget.Blog .jump-link {
    display: none;
}

Here's a complete guide with screenshots on adding CSS in Blogger blogs

  1. Log-into your Blogger Dashboard
  2. Go to the Theme   section
  3. Click on "Customize" 
  4. In the Theme Designer go to Advanced > Add CSS
  5. Paste the CSS snippet into the text area on the theme designer page and click on "Apply to Blog" on the top right
Refresh your blog to see the changes live on your blog.

Showing full blog posts on other new themes

The same can be done on other themes and here are the links for the tutorial to do it on other new Blogger theme(s)


Semi-Transparent Header on Blogger's Notable Theme

The header on the Notable theme in Blogger sticks to the top when you are scrolling down, that's a neat design and good thing for mobile users who may otherwise find it difficult to scroll all the way up to access the navigation menu.

In this post we will use a small CSS snippet that let's you make the header semi-transparent or in simple words a see-through navigation menu. You can set the opacity yourself to fit your needs since you may want it to be less or more opaque. 


Our posts are known to stretch a little bit too much so we are going to keep this short because there's not even much to it. There's a CSS snippet that you add to your blog's theme, that's all. 

The CSS we will need. Note that this is for the Notable Blogger Theme, this may or may not work with other themes. 

header.centered-top-container.sticky {
opacity: 0.8 !important;
}

The value 0.8 is the opacity of the header, it can be anywhere from 0 to 1.0, setting it 0 will cause the header to be completely transparent so we do not want that. You may change the value to your needs and then add it to your blogger.

How to add the CSS code?


  1. Log-into your Blogger Dashboard
  2. Go to the Theme   section
  3. Click on "Customize" 
  4. In the Theme Designer go to Advanced > Add CSS
  5. Paste the CSS snippet into the text area on the theme designer page and click on "Apply to Blog" on the top right
That's done. Now refresh your blog to see the changes. 

If you have request for tutorials for other Blogger themes then please do comment below. 

Automatically Place AdSense Ads After Jump Breaks in Blogger Blog Posts

The placement of ads on a website is a very important aspect to maximize the revenue from ads on your blog. Ads placed inside of articles in a standard way i.e in a way that the user can distinguish between the content and the ad is very effective.

In this tutorial we will go through the steps to set-up the blog in a way that an AdSense ad block is automatically added after the page break in a post.



For a demo you can take a look at our blog post, an ad is just right below the last paragraph (it is where we added the page break for this post). It is important for a page-break to exist in the post for this tutorial to be effective.

We assume you add page breaks or more commonly called jump breaks in Blogger, in your blog posts.

Getting started with the tutorial

We are going to make changes to the template code in order to add this functionality so we suggest you to make a backup of your blogger template before proceeding. Check this tutorial on backing up a blogger template

Adding the Google AdSense Script. 

You may have noticed that you the AdSense script is given with all of your AdSense Ad snippet though AdSense implementation guide tells us that only loading it once is sufficient enough for all ads to work. 

The script that we are talking about is wrapped in this line of code, you may have noticed it several times if you have worked with AdSense codes which we assume you have. 

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

We will be adding this script in the head of the blog's template so that our automatically added ad works properly.

  1. Open your Blogger Dashboard > go to the Theme section
  2. Click on Edit HTML button for the template's code show up
  3. When you are in the template code editor, hit CTRL+F / CMD+F to open search box and search for </head>
  4. Copy the following line of code and paste it immediately above </head&gt;

    <script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>

  5. It should be something like this :



    Finally click on Save theme

Preparing the Ad Slot 

Next task is to prepare the code that we will be inserting into the blog post after jump break. It is suggested that you use a responsive ad unit because that works the best on even mobile devices, still you are free to choose any that you like, the choice makes no difference. 

Create your Ad unit in AdSense and click on "Get code", you will get the ad code which should look something like : 

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- My Responsive Ad Unit  -->
<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
     data-ad-slot="xxxxxxxxxx"
     data-ad-format="auto"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

Now, we do not need all of that, only the part that is highlighted i.e line 3, 4, 5, 6 and 7. Open up a notepad / textEdit window and paste your ad code and remove the excess code. You will be now left with:

<ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
     data-ad-slot="xxxxxxxxxx"
     data-ad-format="auto"></ins>

Finally, we now have to edit this code a little bit that is to remove the line breaks in the code, we will be putting this code inside of a JavaScript code as a string so we need it to be without line breaks. Simply use a text editor and remove the line breaks, so the final code would look like this -

<ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" data-ad-slot="xxxxxxxxxx" data-ad-format="auto"></ins>

All on only one line, that is what we need. Keep this code with you, in the next step (which is the final, that's a promise) we are going to need it because it is what we will be inserting using JavaScript code.

Adding the main JavaScript Script for making this work

The last steps may have been a lot tedious, we can understand, but we are almost done, just a few more steps.

This following script is what we need to actually insert our ad unit's code inside of the blog post after jump breaks automatically.

<script type="text/javascript">
// <![CDATA[

document.addEventListener('DOMContentLoaded', function(){
// we look for the jump break
var _moreElm = document.querySelector('a[name=more]');

// here is your adsense code
var _adsenseCode = ' [replace this with code from the last step] ';

// This inserts the ad inside of the blog post
_moreElm.insertAdjacentHTML(
'afterend',
'<div class="adsense-after-break">' + _adsenseCode + '</div>'
);

// Initialize the ads here
(adsbygoogle = window.adsbygoogle || []).push({});
});

// ]]>
</script>


For now copy and paste this into your text editor. There's only one single line that you have to change so that this code works. That is the line 9 (highlighted in the code)

var _adsenseCode = ' [replace this with code from the last step] ';

Delete [replace this with code from the last step] and paste the ad unit code from the last section so it looks like this

var _adsenseCode = ' <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-xxxxxxxxxxxxxxxx" data-ad-slot="xxxxxxxxxx" data-ad-format="auto"></ins> ';

After you've made the necessary changes as explained above we are all set to include it in the theme code. Follow the steps below
  1. Go to Blogger Dashboard > Theme section
  2. click on Edit HTML
  3. In the template code editor hit CTRL+F / CMD+F and search for </body>
  4. Paste the code we have immediately above </body> and save the theme. The code would look something like this when in place

     
That's it! You've done it. Now reload your blog and go to a blog post to see the ad appear automatically in your blog post. 

In case it doesn't seem to work then make sure
  • that you have JavaScript enabled and there is no ad blocker enabled. 
  • that you have a jump break in your post
  • that your ad unit is active. New ad units may take some time to start showing ad. 

Bonus: A little styling

The following CSS will add margins around the ad unit and also a border for users to visually distinguish between the content and the ad.

.adsense-after-break {
/* margin and the padding */
margin: 0.5em 0;
padding: 0.5em;
/* Center align */
text-align: center;

/* Following styles the border */
border: 1px dashed #ccc;
border-width: 1px 0;
}

Copy the CSS code above and then add it to your blogger theme.


We hope you find this tutorial helpful. If you have questions / suggestions or feedback feel free to comment down below. 

FancyBox 3 Image Lightbox & Slider for Blogger.com Blogs

Lot of us posts photos on our blogs daily and being able to view it in light box / gallery view is a basic function for every blog and Blogger does provide one but one that is very old and needs an upgrade so we have decided to post this tutorial to help you add FancyBox 3 in your blogger blog.


FancyBox 3 is an image / content light-box plugin that provides the feel of a modern and responsive website. If you have had experience with the Blogger's default light-box feature you may have felt that it is very basic and for a blog that focuses more on photos and images it might not be the best option.

Demo & Comparison

For example, here we have two photos, the first one is set to open in Blogger's default light-box and the other is the FancyBox light-box plugin.

Here's a demo on a test blog - Demo for Image Lightbox 

Images with Blogger's Default Lightbox


  

Images with FancyBox 3 Lightbox

  


The jQuery plugin, FancyBox plugin is more than just a image lightbox / gallery, it can do a lot more than just images but in the Blogger environment we will be just focusing on images because that is what we need here.

Here are a few attractive features of the FancyBox plugin -

  1. Modern design and feel
  2. Responsive and touch enabled, works flawlessly on mobile devices. 
  3. Full screen and zoom option
  4. Slideshow option for multiple images in a gallery (i.e a post in Blogger blogs)
  5. Very flexible - if you know basic HTML / JavaScript you can do a lot more with this plugin. 

Setting it up

Note: Before starting consider taking a backup of your current Blogger template

The FancyBox 3 plugin is a jQuery based plugin and for it to work jQuery needs to be added to your template as well though many templates (most likely if it is a third-party template or you have previously added such plugins) may already have jQuery added into it and it is not recommended to add it again as that just makes the page load the same thing twice which is not good for the performance of a website. 

Check if you already have jQuery:

In this tutorial we will be asking you to add certain script files required for the plugin to work, jQuery code too, though if you already have it on your blog then avoid adding it again is the best option.

To check whether you have jQuery or not follow these steps -

  1. Go to your Blogger Dashboard > Themes
  2. click on Edit HTML 
  3. open in-page search CTRL+F/CMD+F and enter the keyword "jquery"
  4. Does it take you to a line with "<script src='.../jquery.min.js' " (may look similar) ? If yes then you already have jQuery
  5. And if not then you do not have it, so in the next steps be sure not to omit the jQuery script. 

Adding the scripts and stylesheets

The Fancybox plugin is a lightweight jQuery plugin with a lot of functionalities. It depends on jQuery to work, and a stylesheet that tells the browser how to display things under it, in total there are 3 files we will be adding, namely - jQuery, FancyBox Script and FancyBox Stylesheet. 

Note: If you already have jQuery in your template it is recommended you remove the line from the following HTML markup that adds the jQuery script. 


Copy the following HTML snippet, 

<!-- FancyBox CSS -->
<link href="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.0.47/jquery.fancybox.min.css" rel="stylesheet" type="text/css"/>

<!-- jQuery -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>

<!-- FancyBox 3 -->
<script src="//cdnjs.cloudflare.com/ajax/libs/fancybox/3.0.47/jquery.fancybox.min.js"></script>

Upon copying paste it in a Notepad / TextEdit application. When you have the code snippet in a text editor remove the line with <!-- jQuery --> and the line after that if you found that jQuery already exists in your template, else keep the whole code without making any changes. 

To add it in the template, 
  1. Go to your Blogger Dashboard > Theme
  2. Click on the Edit HTML button on the page
  3. search for </body> 
  4. Paste the code immediately above the </body> tag
  5. Save the theme.

The </body> tag is basically the end of the body of the page and that is where we are adding the scripts because such scripts are run only when the complete HTML has been loaded. 

In case you already had jQuery in your template and you deleted the jQuery from our code then do remember that these scripts should always come after the jQuery's script, adding them before it may result in error. This is a common mistake people make, and confirming this can save you a lot of time in figuring out what went wrong.

Disable Blogger's Lightbox

The codes we added in the previous section has no effect on your images now and that's normal, we haven't initialized the scripts so you wouldn't be able to open it using FancyBox lightbox plugin as for now, we will be doing that shortly, but before that make sure you turn off Blogger's default image lightbox as it may conflict with the one we've added.

  1. Go to your Blogger Dashboard
  2. Settings > Posts, comments and sharing settings
  3. Next to "Showcase images with Lightbox" choose "No" from the dropdown list. 
  4. click on the "Save settings" button on the top right of the page.
Great, now the lightbox from Blogger is disabled and we can continue on activating our new lightbox plugin. 

Activating the plugin on photos / images

Without specifying which images is to be activated in lightbox we assume that all images inside of the post body that has links to an image is supposed to open in the lightbox. 

It is important for us to tell the plugin that "Hey, don't have effect on images outside of the post body" that's because there are many images all over the blog that you don't want to be opened in the lightbox so we isolate the plugin within the post body. 

Copy the following code,

<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
/**************************
This part makes sure we select only the images and photos that is supposed to appear in a lightbox
**************************/
$(".post-body a img").each(function(){
var isImage = /\.(?:jpg|jpeg|gif|png)$/i.test( $(this).parent("a").attr("href") );

if ( isImage ) {
$(this).parent("a").attr('data-src', $(this).parent("a").attr("href"));
$(this).parent("a").attr('data-fancybox', 'postLightBox' );
}

else {
// .. do nothing
}
});


/**************************
This part initializes FancyBox on the qualifying images
**************************/
var options = {
infobar : true,
buttons : true,
speed : 300, // Animation duration in ms
margin : [40, 20] // Space around image, ignored if zoomed-in or viewport smaller than 800px
};

$("[data-fancybox]").fancybox( options );
});
//]]>
</script>

You have to add this code after the line of code we added in the "Adding the scripts and stylesheets" part of the tutorial.
  1. Go to your Blogger Dashboard > Theme
  2. Click on the Edit HTML button on the page
  3. search for </body> 
  4. Paste the code immediately above the </body> tag 
  5. Save the theme.

It's time to test it! After saving the theme open up your blog and go to a post with images and click on the image and it should now be opened in the new modern light box rather than the old one Blogger provides initially.

Have questions? 

You might have questions about the plugin or something about it that isn't working as you expected, we've put down some common questions and its answers for you - 

Is FancyBox safe to use?

Yes, it is one of the most popular jQuery plugin for content lightbox on the web and it is used by hundreds of thousands of websites. 

Learn more about it on FancyBox's homepage.

Would it work in the new Blogger themes?

Yes, it is supposed to work perfectly in the newer themes. If you are facing issues with any theme please comment down below with your blog URL and we will take a look.

As for third-party customized themes we cannot guarantee.

How can I make it work only on the images I want it to?

The part $(".post-body a img").each(function(){ in the code that activates tells the plugin which images to choose and by default it activates on all images inside of a post body. 

If you want it to work only on certain images and not all then follow these steps 
  1. Open your blog post in the post editor and click on the HTML button next to the Compose button 
  2. When you are in the HTML mode, look for the image's code which might be something like

    <a href="[.....]"><img src=" [.....] "/></a>

    To the <a> tag add a specific class name value to it, for e.g

    <a class="lightbox-image" href="[.....]"><img src="[.....]"/></a>

    You can notice we added class="lightbox-image" to the <a> element.
  3. In the JavaScript snippets change

    $(".post-body a img").each(function(){

    to

    $("a.lightbox-image").each(function(){

    And save it to the template code.
Now images which is inside an anchor link i.e <a> tag that has a class name that you defined, here we used "lightbox-image" (you can use anything else that starts with an underscore or an alphabet).

I would like to add captions to my lightbox images, how do I do it?

Caption that you want to appear for a image should be manually added in the source of the image's HTML code. Here's how you can,

  1. Open the post in the post editor and switch to the HTML mode 
  2. Look for an image's HTML code, at minimum it would look like this

    <a href="{image-url}" >
    <img href="{image-url}"  />
    </a>

  3. Add data-caption="Your caption here" to the <a> of the image, e.g

    <a data-caption="This is a caption of the image" href="......." >
    <img href="........"  />
    </a>

  4. Save the post. 
Basic HTML is supported inside of the data-caption attribute, so you can add italic, bold or large text inside of the caption as well.


I want to customize it according to my needs, how do I do it?

If you have a good knowledge of JavaScript, HTML and CSS then you can head over to the plugin's homepage and take a look at the documentation to learn how to customize it - http://fancyapps.com/fancybox/3/

Not everyone is a coder we understand but to customize it according to ones' needs some advanced knowledge is needed. You can hire or ask a web developer / designer to help you out.

If your need is not big and what you want can be achieved by simply modifying a few codes here and there I can provide your free of cost help though in case it requires good amount of time and work I am available for hire as well. You can contact me at depy45631@gmail.com for any help or hiring me for a work.

Anything else?

For feedback, suggestions and requests please comment down below. 


Customizing Body Width of Soho Blogger Theme

Blogger's new themes are responsive and you get a very little option to change the set width of the main area. The theme designer doesn't even an option to adjust the widths either.

We will use custom CSS codes to customize the width of the Soho theme's blog area to stretch more than the default setting.




This post would be very short, the reason for this being short is that this tutorial will simply teach you how to do a specific thing - here setting the width and that doesn't require too much technical background. Also we will be posting a series of customization tutorial for Blogger's new Themes (Soho, Contempo, Emporio and Notable), be sure to subscribe to our blog for updates.

Getting Started

Currently the largest width Soho theme stretches is 1000px, if the screen is more than 640px the blog post area as well as header & footer will stretch as much as 1000px.

The width of the parts of the theme is dependent on the available screen width, this is the nature of response web design. Nowadays everybody has screens larger than 1000px in width so it is a good idea to stretch the blog wider on larger screens than to leave empty areas.

CSS Snippet

Following is what we need, you don't have to customize it, it works well with existing standard screen widths and stretches the areas as required. Copy the CSS code -

/* For screen widths less than 1280px */
/* For screen widths less than 1280px */
@media screen and (min-width:1280px) {
.centered-bottom, .centered-top {
width: 1180px;
}

body.item-view .widget.Blog .post {
width: 800px;
}
}


/* For screen widths less than 1400px */
@media screen and (min-width:1400px) {
.centered-bottom, .centered-top {
width: 1300px;
}

body.item-view .widget.Blog .post {
width: 1060px;
}
}



After copying keep it in a notepad / textedit app since we are going to need it in the next step.

You can customize the values according to your needs if you know what you are doing else it is suggested you post a comment down below explaining how you want it to be different for your use so that we can help.

Applying the CSS

For a complete guide on adding CSS codes in Blogger refer to this tutorial - How to add CSS to your Blogger Blog.
  1. Open your Blogger Dashboard and choose the blog
  2. Go to the Theme section
  3. click on Customize
  4. Navigate to Advanced Add CSS
  5. In the Add custom CSS text field enter the copied CSS code from the previous section. It should look like this -




  6. Click on Apply to Blog to save the changes and go to the blog to see it live. 

That's it. Once the CSS is applied you will start seeing the customized width live on the blog. 

What's next?

We plan on posting more small tutorials like this on customizing parts of new themes. If you have any suggestions email it to us on depy45631@gmail.com or post your idea in the comments below. 

Show Full Blog Posts in Homepage of Contempo Theme in Blogger

After so many years Blogger has finally brought advanced and modern themes, which are responsive, optimized for mobile devices and are beautiful!

The need of every Blogger is different, same is in the case of snipped post that appears in homepage for Contempo Theme. The theme will only show a small excerpt of your blog posts on the home page, in this tutorial you will learn how you can change this behavior and have the full post on home and index pages.



For years blog owners want to have a way to show automatic post summaries, there still exists hundreds of tutorials for the templates that came out before these new modern themes. But not all blog owners wants to show a snipped version of their posts on the main page of their blog.



Blogger doesn't give you any option in the settings to disable / enable post snippets so we figured out a way to do that directly from the theme code.

Getting Started with the Tutorial

IMPORTANT - Since you will be working with template codes of your blog it is highly recommended that you take a backup of your Blog's theme before proceeding

Follow each step carefully and in steps that deals with codes we've provided screenshots of what you should be looking for to make the process easy and fast.

Changing the Theme XML Code

The first and most important part is to change the XML code in the theme code that is responsible for showing blog posts in different styles. 
  1. Sign-into your Blogger profile
  2. Select your blog from the blog list 
  3. Go to the Theme section > click on Edit HTML button on the page
  4. When the theme code editor opens, put the cursor inside of it and press CTRL+F / ⌘ + F to open the in-page search box
  5. In the code editor you will be looking for the following block of code

    <b:if cond='data:view.isSingleItem'>
    <b:include data='post' name='postBody'/>
    <b:else/>
    <b:include data='post' name='postBodySnippet'/>
    <b:include data='post' name='postJumpLink'/>
    </b:if>

    You do not have to enter the entire block of code in the search box, use only a small part from the code block which should bring you to the same exact code in a few tries.

    This is how the code that you are looking for in the theme code editor



  6. Once the code is visible on your theme editor, use your cursor to select from <b:if... part to the ending </b:if.. part,

  7. Upon highlighting it, delete the highlighted part. 
  8. Copy the following code which we will be placing in the place of the previous code (that we deleted in the last step)

    <b:if cond='data:view.isSingleItem'>
    <b:include data='post' name='postBody'/>
    <b:else/>
    <b:include data='post' name='postBody'/>
    </b:if>

    After successfully placing the code given above, the theme code editor should look like this with the code in place :


  9. Now click on the "Save theme" button to save the theme.
  10. Visit your blog to see the changes live, you may need to clear caches if you are not able to see any changes. 
If you noticed that the blog posts are not snipped now but still aren't showing as full then probably you have put a page break in your blog post, removing it should fix this, see the section "Remove Page Breaks from Post" below. 

Hide the "Keep Reading" Link

The "Keep Reading" jump link might have not gone away. This following CSS code will help in hiding the link from the posts on home page. 

Copy the following CSS code :

.jump-link {
display: none;
}

And add it to your blog. [See how to add CSS in a Blogger Blog]

Remove Page Breaks from Post

In case you put page breaks in your posts the posts may not appear full. So if you want a post to be shown full instead of till the page-break part remove the page break from the post.

  1. Sign in to Blogger.
  2. Click the post in the post editor.
  3. In the composer box, place your cursor after the page-break element (it is a grey horizontal line with dashes) 
  4. Hit backspace to remove it.
  5. Save the post. 

What about other themes like Soho, Emporio and Notable

We're glad you asked this - the same code doesn't exist in other themes so this tutorial isn't applicable for other new themes. Following are the tutorials for other new Blogger themes to do the same on it.




Blogger Page and Post Titles Style for Better SEO

Definitely content is the king, but how we present the content to the people and also the search bots is an important aspect. In this post we will talk about how to display page titles of your blog in order to get highest visibility on search engines like Google.

SEO short of Search Engine Optimization is a broad topic on how to maintain and create a website / blog that performs well enough with search engine bots so it comes up on user queries at the best ranking possible. 

That doesn't mean SEO is a very complicated topic, yet applying it might be somewhat require a learning curve since editing code and adding functionalities to websites require one to be familiar with codes. 

What's with the page title of Blogger Blogs?

Skip to the next section to learn how to optimize the blog's page title, to learn more about it read below.

The page title we are talking about is the document title of a web page that appears in most browsers in the tab - in HTML it is situated in the HEAD of a web page as
<title>Blog Title - Some Example Page</title>

Majority of Blogger templates (expect for the themes that has been recently introduced) have a very unconventional and non-optimized for search way of display the page title on posts in Blogger blogs.

Each of your posts is a different web page on your blog, and it is important that all of them are optimized for SEO, primary focus should be on the content, and another important aspect, which we are discussing here, is the page title, it's the part that appears on search engine's results.

Check this and ask yourself, which one gives a human being more detail about the search result for the term "How to add CSS to Blogger Blogs"?



Search engines wants values small but descriptive page titles, it is a bad idea to take up a significant amount of space in your page title with your blog's title.

A page title on posts page can be and generally are consisted of two parts, "The post title - The Blog Title", the problem with many Blogger themes / templates are that it puts the blog title first even on post pages, so if one has a blog named "Alison's Travel Photography Blog" a blog post on the blog will have a page title like "Alison's Travel Photography Blog : This Is The Title of The Post"

We are just going to optimize this for search in Blogger.

Optimizing Page Title for Search Engines

This is a very small change to make though it can make significant amount of difference in your search rankings and we recommend you to do this if your page titles aren't optimized yet.

Blogger has launched new themes recently which already has better page title than the old ones, but if you are using a third-party template or Blogger's default templates follow the steps below.

For Normal Blogger Templates and Third-Party Templates

It is recommended that you take a backup of your template before proceeding. 

The following steps are for normal blogger templates that you can choose from the theme selection area in Blogger or third-party templates based on those templates.
  1. Go to your Blogger Dashboard (https://www.blogger.com)
  2. On the blog's dashboard, go to the Theme section

  3. When you are in the Theme section, click on the "Edit HTML" button under your blog's preview.
  4. After the template code appears on the screen, focus in the template code area and hit CTRL+F / ⌘ + f and search for the following piece of code, tip: only enter <title> should bring this up.

    <title><data:blog.pageTitle/></title>

  5. Delete the line of code that found in the last step, and replace it with this code:

    <b:if cond='data:blog.pageType == &quot;index&quot;'>
    <title><data:blog.title/></title>
    <b:else/>
    <title><data:blog.pageName/> | <data:blog.title/></title>
    </b:if>

  6. Save the template and visit your blog. Check your page's title in the browser's tab to see if it is SEO optimized or not. 

The "|" is a character that will separate your current page name and the main blog title, i.e "My Blog | An example blog post title" or "Stramaxon | How to add CSS" etc. 

If you like you can change that to something else such as "/", ":", "||". It is a preference but may also have some effect on SEO, so pick a different one only when you are sure what you are doing. 

EXTRA: Adding Blog's Tagline in Title

The instructions in the section above works great even without modifications but if you like you can add a tag line of your blog in the page title so that it appears in the browser's tab and most importantly in

Benefit of adding a tag line: If your blog's title is short, then adding a tag line makes fill up the left space. Your blog's results will look better and your reader can tell what your blog is about right from the search itself.

The code that you were given produces the result like A, and the following will produce the result B. It is highly recommended you add a tag line for your blog if your blog title is short.

Here's the code (similar to the code in the main steps, only added the description part):

<b:if cond='data:blog.pageType == &quot;index&quot;'>
<title><data:blog.title/> - Enter your Blogs Tagline</title>
<b:else/>
<title><data:blog.pageName/> | <data:blog.title/></title>
</b:if>

Copy the code and paste it first in a notepad editor, and replace the part Enter your Blogs Tagline with your own tag line: Keep it short and descriptive, it is what will appear in searches along with your blog title, so make it attractive, short and simple.

The steps to add this code is similar to the steps given in the previous section.

Search Optimization and Results

Following this tutorial and making this change to your blog may or may not give you immediate results. To improve your search visibility you still have to post genuine and content that your readers would like to read, this tutorial helps you make your blog's visibility better for what you already have and going to post in the future on your blog. 



If you have questions or have any suggestions then please do comment down below.


The tutorial will be updated to list steps for new Blogger themes...

Solving Blogger Template Error for AdSense Ad Implementation

If you are recently enrolled in AdSense and you are trying to implement ad code that you got from AdSense directly in your Blog's template you might have run into problems, we will walk you through fixing it.



If you are trying to add code from AdSense which looks something like this (there is a difference between the two codes, which we will explain)

Demonstration of the ad code in Blogger template and the error that occurs


<script async src="//pagead2.googlesyndication.com/
pagead/js/adsbygoogle.js"></script>
<!-- leaderboard -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-xxxxxxxxxxxxxxxx"
data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

OR

<script async src="//pagead2.googlesyndication.com/
pagead/js/adsbygoogle.js"></script>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>

The the only difference between the two snippet is that the first one displays an ad, whereas the second one is used only to load AdSense's JavaScript files.

In many cases to improve page load speed you just want to load the scripts once because AdSense ad codes always include the ad-block HTML code as well as the scripts. Or when you are enabling Page Level Ads the script tags needs to be added in the template once, the following code is give, which you are supposed to implement in your Blogger's template / theme




The error that you might be getting when trying to add these code snippet in your template is

Attribute name "async" associated with an element type "script" must be followed by the ' = ' character. 

Fixing the error

There's nothing wrong with the code, according to HTML5's standard it is an error free code, but Blogger's template / thee is coded in XML and it fails to parse it because of a small part in the codes

Right now we have (note that we are only displaying the part of code that requires modification, rest should be left untouched),

<script async src="//pagead2.googlesyndication.com/
pagead/js/adsbygoogle.js [...]

The problem here is that the "async" attribute has no values passed into it, for e.g "src" has a "=" sign with a value in it. All we need to do is pass a value to the attribute and Blogger will accept it.

<script async="async" src="//pagead2.googlesyndication.com/
pagead/js/adsbygoogle.js [...]

Notice the difference between the two snippets. We have set it async="async", that makes it comply with XML thus Blogger accepts it and saves the template without any error.



That's pretty much everything to it. Follow the steps given above and save the template, it must parse the code without any problems. If you are facing problems implementing ad-code other than this then don't hesitate to let us know in the comments (add a screenshot for better help)







How to Backup Your Blogger Theme / Template

A step-by-step guide on backing up a Blogger.com Theme / Template for the newest Blogger UI updates.

We have another guide on backing up the template in Blogger but since the roll-out of the newer UI and the changes in the design we are updating the steps with a new tutorial for relevant visual demos.

You can still check the old tutorial on backing up the template here though it is not relevant anymore : http://www.stramaxon.com/2012/03/backup-your-template-of-your-blogger.html

Why back-up a template / theme ?

In the Blogger environment we often want to add a new widget or a functionality in our blog and tutorials ask us to make changes to our templates, it is important we have a backed-up template so if anything goes wrong we can always fallback to the previous version.

There are more reason why -
  1. Making changes to Blogger templates to add functionality or change design
  2. When trying out new themes / template
  3. Using the template / theme again on another blogger blog
Read below for steps on backing up a template / theme, note that we are going to use the terms "template" and "theme" interchangeably. 

Backing Up the Template / Theme on BlogSpot

Let's start with backing up the template.
  1. Log-into your Blogger account to go to your Dashboard. 
  2. From the blog's drop-down list choose the blog

  3. On the left pane choose the "Theme" option

  4. In the Theme section page, click on the "Backup / Restore" button on the top right corner of the page

  5. A dialog box may appear, to download the template backup click on the orange "Download" button as shown below -

  6. A file with a name similar to theme-2887119284088758674.xml will be downloaded. This file is the backup template / theme file, it can be used to recover your template / theme on Blogger. 

That's it, save the theme .xml file at a safe place where you can access it in the future in case you have a broken template. Make it a practice to take a backup of the template before making any changes to it. 

Restoring the Template / Theme Using the XML file

In the previous section you learn how to download a backup of your template. Restoring the template is simple as well, 

  1. in the last section follow till Step #4
  2. Now in the dialog box that opens, which looks like this click "Choose file" (maybe labelled differently on different browsers) -

  3. Browse to the template's XML file and then click on "Upload" 
  4. Once the upload finishes your template will be restored. 
That's it. Do let us know if you have any questions or suggestions regarding this tutorial.