Showing posts with label How to. Show all posts

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. 

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. 


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. 

Changing The URL Of Blogger Posts Even After It's Published

With small advancements in Blogger, users were provided many new options to customize their blog and blog posts for a better search experience, like adding search description and changing the permalink.

But there's a catch, once you publish your post and then try to edit the permalink, you can not! In this tutorial we will explain how you could change the permalink even after it has been published.


Note: Editing of permalink means the older links that points to the post would no longer work. And the customized post would be seen as a new post by the search bots, with the content that was located at another URL before.

Changing the permalink of the post after it has been published is not allowed, as long as the post is in the published status it wouldn't let you do that. That is for obvious reasons, but sometimes you might feel the need of customizing the URL of a post.

Change The Permalink

Let's get to the point, but before that let me warn you again that doing this is similar to creating a new post, copying the content of another published post, pasting it in the new one, setting the date and changing the permalink as per your need and then deleting the old one.

1. Reverting the post to draft

It is only possible to edit the permalink of the post when it is in the draft mode, so we have to first revert our post to draft in order to be able to edit it.

  • Go to your Blogger Dashboard
  • Navigate to the list of Posts and open a published post in Post Editor
  • In the post editor, click on the "Revert to draft" button on the top right of the post editor page right next to the orange button that must read "Update".

  • Now that the post is back in the draft mode, you might now be able to use the "Permalink" option under "Post Settings" to change its URL. Click on the "Permalink" tab on the right sidebar, select the "Custom" radio button and then enter your desired URL for the post.

That is it. Once you have input the desired permalink for the post you are set to publish the post again.

Redirecting Old URLs to the New

If your aim is to just change the URL for presentation purpose while keeping the old URLs still active (considering you have shared the blog post at a lot of places, or others have shared it on social sites and their blogs) then the best option for you is to set a custom redirect.

Blogger has a tool for setting custom redirects for URLs on your blog, and it is very easy. You may find this article by Help Blogger helpful to understand how custom redirects work and use it correctly.

How to Set Custom Redirects in Blogger http://helplogger.blogspot.in/2014/07/how-to-set-custom-redirects-for-blogger-post.html


Facing difficulties in going through the steps? Let us know in the comments below. 

Renaming "Older" and "Newer" Page Links in Blogger

Two years ago I wrote a post on hiding "Newer"/"Older" pagination links on Blogger and I was recently asked by a reader if it was possible to rename the links name, yes it is, and in this tutorial you are going to learn that the safe way.

Why is it the safe way, is there any side-effects? Not really, but this tutorial takes you into editing a few lines of code in your template so chances are that if you accidentally make any mistakes then the template might just broke and you have to fix that problem first to get your blog running again.





Back-up the Template

As a precautionary step make a backup of the template so that if anything goes wrong you can always revert it back to the current template: How To Backup Your Template

Two Ways To Do It

Before we start take note that we are presenting you two different ways to do this. The first method affects it from the root while the second one is like a layer, it renames it using JavaScript code when the page is loaded.

Difference? The first method internally changes the name to what you like, the JavaScript way is done on the front-end i.e when the page is loaded the text on the pagination links is internally still what it was but the JavaScript code executes and changes the document dynamically on the client-side to change the name.

#1 Method: By Replacing HTML/XML Codes

Note: We assume you are using not using a third-party template. Though this may work with third-party templates too but the naming convention is uncertain for them so we can't be sure if the code we are asking you to search exists in your template or not.

Follow the instructions carefully to rename the "Older" and "Newer" page links.

1. Go to your Blogger Dashboard -> Template -> Click on "Edit HTML" button to open the template code editor


2. Once the template editor opens put your cursor in the code area and then press CTRL+F/CMD+F and look for the following line by entering it in the search box

<b:includable id='nextprev'>

Searching for this line must bring up the matching line of code where we have to make the changes. If there is a triangle arrow on the left of the line in code editor then click on it to show the code inside it.



3. When you click on the triangle right arrow the code inside it will show up and it should be something like or may even be the exact.

<b:includable id='nextprev'>
<div class='blog-pager' id='blog-pager'>
<b:if cond='data:newerPageUrl'>
<span id='blog-pager-newer-link'>
<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'><data:newerPageTitle/></a>
</span>
</b:if>

<b:if cond='data:olderPageUrl'>
<span id='blog-pager-older-link'>
<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'><data:olderPageTitle/></a>
</span>
</b:if>

<a class='home-link' expr:href='data:blog.homepageUrl'><data:homeMsg/></a>

<b:if cond='data:mobileLinkUrl'>
<div class='blog-mobile-link'>
<a expr:href='data:mobileLinkUrl'><data:mobileLinkMsg/></a>
</div>
</b:if>
</div>
<div class='clear'/>
</b:includable>

4. Now look for <data:newerPageTitle/> and <data:olderPageTitle/> in the above code inside your Blogger template code editor. To make it easy we've highlighted the lines which contain these two codes.

<data:newerPageTitle/> - Generates the newer page link text, by default "Newer Post"/"Newer Posts" for post page and index/archive pages respectively.

<data:olderPageTitle/> - Generates the older page link text, by default "Older Post"/"Older Posts" for post page and index/archive pages respectively.

Replace each with the text you want in place of it. For example suppose I want "Previously Written!" & "Next For Read!" to replace the default text then my code would look something like this.

a. For "Older" page link I would replace the 2nd highlighted part with this:

<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'>Previously Written!</a>

b. For "Newer" page link the edit on the 1st highlighted part in the main code above would be this

<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'>Next for Read!</a>

Use your own text you want to replace the default pagination link text and then save the template. If you did it right then the changes must appear on the blog like this:


#2 Method: Using JavaScript

This doesn't require much edits and is also easily revertible. But this is just like a layer, while the actual text that was generated during the page was still the default one, this JavaScript changes the DOM to the change the text inside the specific page links.

<script type='text/javascript'>
function changePageLinkText(a, b) {
document.getElementById("blog-pager-older-link").children[0].innerText = b;
document.getElementById("blog-pager-newer-link").children[0].innerText = a;
}
document.addEventListener("DOMContentLoaded", function() {
var newerText = "Enter Newer Text"; // Replace [Enter Newer Text] with your own text
var olderText = "Enter Older Text"; // Replace [Enter Older Text] with your own text
changePageLinkText(newerText, olderText);
});
</script>

Replace the text "Enter Newer Text" and "Enter Older Text" with the text you want to appear in the corresponding links.

To place this code in the template, go to Blogger Dashboard -> Template -> Edit HTML -> Now press CTRL+F/CMD+F and search for </body> and place this immediately before it.

Now save the template and the text on the pagination links will change according to what you've set in the code. You can edit the variables in the JavaScript code anytime you like to change the text that appears.

Note: this may not work in some older browsers and also in browsers that turns off JavaScript.

Remote Debugging Intex Cloud Fx. (Firefox OS) using ADB and WebIDE on Firefox

Recently Mozilla's Firefox OS came to India with the brands Intex and Spice. If you are a developer and trying to test apps or debug your phone using ADB then you might have had a hard time. The official tutorial on Mozilla Developer Network just have listed the basic steps, but to make our Intex device work we need to get our hands somewhat dirty in code.

This guide is meant for Windows users only. Alternatively you can use the vendor ID for the Intex Device if you are on another system and just need the vendor ID.


Before we start, we need to have the following things:
  1. ADB and Fastboot - ADB is included in the official Android SDK, but it is about 800mb, and for one simple application downloading the whole heavy SDK wouldn't be a nice idea. So download this 15 Seconds ADB Installer from the link and install on your system.
  2. Mozilla Firefox 35+ - Currently Mozilla Firefox 35+ is a Nightly Build. But if you don't want to download an 80mb thing again, you can alternatively use the latest Mozilla Firefox which has the App Manager.
  3. ADB Helper Addon - Install the ADB Helper on your Mozilla Browser.
For now we just need these two things in order to get start. 

You need to learn a little bit about using Windows Command Line and ADB. If you know about how to use them you are all set to go!

Connect Your Device

Connecting your device is more than just plugging the USB cable. We need to make some changes on our device so it works without any problem.

Disable Screen Lock

If you have screen lock enable on your device, simply disable it by going to  Settings > Screen Lock (Under "Privacy and Settings")





Enable Remote Debugging

Disable USB Storage in your devices' settings before you enable remote debugging.

Now you need to enable remote debugging in the settings of your phone. Go to Settings >  Device Information > More Information > Developer > And under "Remote Debugging" choose "ADB and Devtools"



We Need USB Drivers for our Device

For ADB to detect our device Intex Cloud Fx. it needs its OEM USB Driers, but the problem is that Intex doesn't provide it, so bad.

But we have got a workaround. By specifying the vendor ID in the adb_usb.ini file in the ADB application directory we can get our device connected to ADB. Here's how:

The vendor ID of our Intex Cloud Fx. Device: 0x1782

Download this file: adb_usb.ini (Dropbox) 

Where to save it? C:// drive > Users > {username} > .android > Paste the adb_usb.ini file there.


Start ADB

Open the "RUN" window by pressing 
Window + R then type "cmd" and hit enter to open the command prompt window.


Now you must connect your device using an USB cable with all the settings mentioned above.

We are now ready to see if the devices is connected to ADB or not. Run the following command and see what it returns:
adb devices

If successful it will show something like:



If not, then you must try unplugging and then plugging the USB cable. Also try it on different USB ports too and check if you have done everything mentioned in the "Connect Your Device" section above.

Now we need to tell ADB to forward the port to the WebIDE or App Manager on Firefox browser to actually get started with debugging. To do that run this command:

adb forward tcp:6000 localfilesystem:/data/local/debugger-socket

You are done! Continue to the final step.

Open Firefox Browser (with either App Manager or WebIDE)

First let's clear the confusion between App Manager and WebIDE, on Firefox 33 and prior App Manager is the default app to manage and debug apps on Firefox OS, and in later version WebIDE replaced the App Manager.

See:
    WebIDE Documentation
    Using the App Manager

I am going to provide instructions for both application. The overall functionality of both the apps are similar, except for that WebIDE is newer it has more updates than the previous App Manager,

Connecting your device with WebIDE

Open your Firefox browser. Go to Tools > Web Developer > WebIDE or simply hit Shift + F8.


Now in the WebIDE Interface, click on the dropdown on the right that says "Select Runtime", if you can see "Cloud Fx." under the USB Devices, then simply click on it and it will get connect.



Else click on "Remote Runtine" and enter the port as localhost:6000 and the WebIDE will be connected to the device. If it succeeds the icon will turn blue and you can access the apps in your devices on the left pane of the user interface.

Now you can debug apps, install your own apps on the device remotely.

Connecting with App Manager

The process is pretty much the same. Connect your device with the adb command prompt first. Then open Firefox browser.

Go to Tools > Web Developer > App Manager 

At the bottom of the screen, you will see the device id in the list of connections available. Click on it and the device will be connected to the app manager.



When connected you will see something similar to this:


Yay! We are done. Now debug the way you want, but just don't damage your phone ;)

Fun things to do!

You can debug system apps like Gallery, Camera etc. And you can edit the HTML, CSS or JS of those apps live and can see the result on the device screen.

If you know HTML/CSS/JS you can really have fun tweaking things on your device. That wouldn't be permanent, as once you close and re-open it will go into its original state.

But you can create your own apps and install it on the phone. 

Easiest Way To Use WhatsApp on PC

Using WhatsApp on PC has been really a hot topic, one obvious answer is to use an Android emulator and then use WhatsApp, but it has its own difficulties. I will show an easy way to use WhatsApp on PC or even Mac.

I don't usually write about such things on my blog, but the method I am using is closely related to one thing I love the most, and that's web technologies.



The most popular method and the only one known to be legit is using the Bluestack Android Emulator, then download WhatsApp and use it, but getting Bluestack to work on your system is a challenge in itself, and if you have a system with old graphics card or low memory then you have no chance of getting it work!

UPDATE: WhatsApp launched WhatsApp Web a while back, and it now also launched Windows and Mac OS version of WhatsApp, download WhatsApp for Windows and Mac. You can continue with this tutorial for learning purpose :)

How? Let's get this started!


Let's first compare the size of things you need to download to get started with using Whatsapp on PC:

BlueStack Method : 103MB (Bluestack Download) + 40MB (Whatsapp Download) =  143MB
Firefox Method : 87MB (Firefox OS Simulator Download) + 38MB (Firefox Browser Download) + 3MB (ConnectA2 App) = 128MB, and no need to download Firefox if you already have Firefox > 32 (latest version)

We will move ahead step by step, as even this isn't easy, just require proper concentration on what you are doing.

1. Download Mozilla FireFox 32+

If you already have the latest version of FireFox then skip this step, else go to http://www.mozilla.org/firefox and download and install the latest version of Firefox on your computer.

2. Installing Firefox OS Simulator

Using your Firefox browser, go to the following URL https://ftp.mozilla.org/pub/mozilla.org/labs/fxos-simulator/ and install Firefox OS 2.0 or the latest stable release (note: downloading older version might not work properly.)



Running Firefox OS Simulator

We are halfway down there! If you have successfully passed the previous steps then bravo, the next steps are really easy.

In Firefox, open the App Manager from Tools -> Web Developer -> App Manager 

Now start the Emulator by click on the blue "Start Emulator" button at the bottom menu


You are now ready.. select the Firefox OS 2.0 or any version of emulator you have installed and a new window might open:


Installing ConnectA2

Whoa! See you are using a mobile OS, that's the fun of Firefox OS simulator. Unlock the lock screen and use it the way you would use any other smartphone OS.

You would need ConnectA2 app to use WhatsApp, so open the Firefox App Marketplace


After it's downloaded, open it and enter your country and phone number, you will be sent an SMS for verification. Enter the code and you are ready to use it!

To add new contacts in your chat list you first have to add that contact in the Contacts list on the Firefox OS. Use the Contacts app to add contacts and then you can simply add them in your WhatsApp.

If you didn't understanding some or not working, you can leave your comments and we will try to solve the problem. Enjoy using WhatsApp on your PC now.

Making Images Fit in Post Body on Blogger

If you are working on a responsive design for your Blogger blog, or you are just tired of resizing your images in post editor to fit in the post container then this tutorial will show you an easy way to make images fit with it's surrounding.

This problem occurs often when you try to post images of the dimension larger than your content area or you are just using a responsive layout and when it down-sizes, the images overflows the content area.



Before you continue with the tutorial, check the demo:
Demo: Without the CSS Demo: With the CSS

In the first demo, the image in the container overflows because the width of the image is larger than that of the image, but in the second demo, if the image width is greater than the container's, it will fit itself to the container.

The Code!

All this can be achieved with a small block of CSS code. Before I start giving you lectures on how this works, here's the code for you to use (can be used in most Blogger Templates, but you might need to change the selectors if you are using a custom designed template):

.post-body img {
max-width:100%;
max-height:auto;
}

Now you just need to apply this code to your blog, check this tutorial to learn how add CSS in Blogger.

How does it work?

If you are not a web designer or coder, then this might all seem like a magical charm to you, but it's just code, code that's made to make your life easier. Well, so if you are ready to get bored then I am starting my chapter on CSS.

What actually does the magic is the max-width CSS property which gives any element a maximum width limit. So if you specify an element the the maximum width of 200px, it wouldn't exceed it. The 100% value tells the browser that the element(s) must not exceed the full content width of the container.

The max-height property helps in keeping the original proportion of the image intact. To know more about what would happen if you specify a value in percentage then try and check the results ;)

How to Open Developer Tools in Different Browsers

Developer tools or shortened DevTools are set of tools used for debugging web pages which is important tool for web developers and also general users who wants to inspect a page, make changes to the site on the front-end or analyse network usage by the webpage.

It is a all-in-one tool for a person who wants to learn what happening behind the scenes of a website. If you are new to it you may want to learn about, I wrote a post about using Chrome Developer Tools but if you need a more brief information about it see this
https://developers.google.com/chrome-developer-tools/

Chrome and Safari's developer tools are very much the same. But Mozilla Firefox has it's own unique developer tool set but using it is almost same as using any other developer tool.

Google Chrome

Google Chrome in my opinion is the best browser for web debugging using DevTools. DevTools are frequently updated and are simple to use.

Starting DevTools on Chrome

Starting DevTools on any webpage is very easy. There are three ways to open the console :

1. Select the Chrome Menu  > Tools > Developer Tools

2. Right click on a blank area of the page and from the list of options click on "Inspect Element" at the bottom. To inspect a particular element right click on the element and then select the inspect element option.

3. Another way to open the console is keyboard shortcut. Press Ctrl+Shift+I (Cmd+Shift+I on Mac) and the developer tools will appear.


Starting JavaScript Console in DevTools

JavaScript Console is used to run JavaScript codes on a page. It's often used to test scripts on a website to check if the code works well or not. But you can use it as a calculator or just try out JavaScript functions using it.
To directly open the JavaScript Console select the Chrome Menu  > Tools > JavaScript console or use the keyboard shortcut Ctrl+Shift+J (Cmd+Shift+J on Mac).

When the Developer Tool is opened select the "Console" tab on top to switch to JavaScript console.

Mozilla Firefox

If you are using Firefox make sure you have the latest version, as older versions don't include developer tools or if they do, they are old. Developer tools of new Firefox is way better than the older version and got some extra tools too.

Starting Developer Tools on Firefox

You can it by various ways. The most common way is to open it using Inspect Element option. Right click on a blank area on the web page and from the list options select "Inspect Element", the Firefox Developers tools will open.

Or if you can open it by going to the Tools menu > Web Developer > Inspector, this will open the developer tool in page inspector mode.

Opening JavaScript Console

Accessing JavaScript console in Firefox is similar to opening the page inspector. Open the Developer tools by right clicking on a blank area and then selecting the Inspect Element option. Now just switch to the "Console" tag on top of the dev. tools.

Or you can also open it through the tools menu. Click on Tools > Web Developer > Web Console or use the keyboard shortcut CTRL+SHIFT+K.



Apple Safari

Accessing developer tools on Safari is similar to as in Chrome. Some keyboards shortcuts might be different. Simply right click anywhere on the page and press Inspect element.

If you have any question ask it in the comments.  

Getting a Blog Address Already Taken but not Used

You all know Blogger is a free service and you need to pay nothing to get a free blog with your own unique blog address (with a .blogspot.com prefix) but not everyone's not that lucky to get their favourite blog address.
Blog address i s not a major issue but yet people badly wants their desired address for their blog. If you were not able to get a blog address because it's already taken but not used by the current owner, it's obvious to get frustrated. You want that address but you can't get it just because someone else owns it and they don't even write anything on it.

Contact the blog owner

Blogger don't delete a blog even it haven't been updated since 10 years , blogger doesn't delete a blog for inactivity. But don't lose hope you there are still chances to get the desired address. If you can find contact information on their blog, blogger profile or any other social networking site and if he/she is a friendly person you can ask him/her to transfer the blog address to your account.

But why transfer, Can't he just delete it and then I can create the blog with that address ? No! Don't do it or you will have to wait 3 months or more to get that blog address. When you delete a blog on blogger, it isn't deleted instantaneously, the user have 90 days to undelete it. So the blog address doesn't become available before 90 daysr. Read more here :
http://www.stramaxon.com/2012/07/blog-removed-url-not-available-blogger.html

And to learn how to transfer blogs between two accounts read this
http://www.stramaxon.com/2012/03/transfer-blog-from-one-account-to.html
http://support.google.com/blogger/bin/answer.py?hl=en&answer=41448

Can't contact the owner?

If there's no way to contact the blog owner you have less chances to get that blog address. Many people on Blogger Help Forum request Blogger to get them their desired blog address even if it's being used for an other blog, but blogger can't do it. Blogger can't harass owner for the blog address.

What should I do now?

I believe a blog address doesn't matter that much for a blog. You couldn't get a neat blog address like
flower.blogspot.com try something different like my-flower.blogspot.com there's no advantage or disadvantage in using any of those blog address, what readers really want is content. Read this
http://blogging.nitecruzr.net/2009/05/value-of-your-blog-is-based-upon.html


But if you still want a your desired blog address, consider buying a custom domain, which cost not more than $10 per year. Try GoDaddy, search for a domain from here



Or if you want a self hosted website, GoDaddy has those services too

Put your business on the Web for a buck a month!

Open Links in a New Tab on Right Click Disabled Sites

Disabling right click on websites and blogs are not a common thing among bloggers who don't want their sites content to be copied.
Disabling right click is quite useful (but it doesn't completely stops a user from copying the content) but for the visitors it can be annoying and a very bad experience exploring a site with right click disabled.

One of the biggest problem is opening a link in a new tab. If you have a mouse with a three buttons (check if your scroll button is clickable) you can open any link by clicking on it using the middle button but if you don't have such mouse then might probably get mad and perhaps punch your monitor screen too !

But if you are here then you considered to Google a solution for this instead of damaging your PC.
   

Opening a link in new tab

Could have been easier if you had a mouse with three buttons but don't worry, I won't make you spend money just to open links in a new tab.

The easy way is to use CTRL + Left Mouse Button (LMB) and for Mac CMD + LMB (not sure - I don't have a Mac). It should now open the link in a new tab.

But if you have a mobile device then god bless you :( but don't lose hope, Google again for a solution for mobile devices.

Update: I am soon going to launch a Chrome extension that will make links on a site to open automatically in new tab on click.

For Website/Blog Owners

If you have a blog or website with right click disabled then you might place a notification box that should tell the readers what to do to open a link in a new tab.

But the better way is to add the target='_blank' attribute to your  external anchor element so it opens in a new tab by default.

And if possible, don't add any alert message on right click. Disabling right click is okay but to show an alert irritates. Check Disable Right Click Without Using JavaScript even this tutorial uses JS but not a big JS function and the best thing is that it doesn't send out any alert message to scare the right-clickers (who aren't always content copiers) but I always say that it's impossible to stop the bad-a*s content copiers to copy your content so always be ready to use the Removing Content from Google form and the best part is that human will respond to your reports!

Retrieve Blog Posts from Old Deleted Blogger Blog

You had a blog some years back but then you deleted it, now you want to save those memories but the problem is you can't access the blog as it was deleted, so is there any way to retrieve those blog posts ? Yes it is and in this post I will tell you how.
It happens, we realize the importance of old memories later and then we want it back without any idea of how to get it. Many people use blog as their online public diary (sometimes private) to write about their daily experiences and memories but sometimes you feel that you don't need it anymore and some years later you want your old memories back, all the blog posts you posted you want it back, but the bitter truth will be that you deleted it and have no longer access to it.




Note: Google Reader will be discontinued from 1st July. Without Google Reader this trick will be ineffective. Make sure to backup your Google Reader content here

Enough discussion about the case, coming to the main topic, questions arises that how would you retrieve it the old posts ? Read further to know how

Retrieving back the blog contents

Every blogger blog has it's own feed URL and it's stored automatically on Google's server whenever you post it but when the blog get's deleted, you can no longer open the feed URLs but there's another way to do it :

Use Google Reader

Google reader is activated for every blogger blog by default and the posts fetched from the feed URL and are stored on your account. The most amazing thing about Google reader is that it doesn't delete the post even tough the blog is no longer online or has been deleted.

It's extremely easy to restore contents from your blog using Google reader, just follow these instructions  :
Login to your Google Reader (https://www.google.com/reader/) using your Google Account user details.
Now we need the feed links to access the blog's feed using reader and the feed link is
https://www.google.com/reader/view/feed/http://yourblog.blogspot.com/feeds/posts/default
I am sure you know what to change in the URL, the blog address! Ofcourse, if you want it to redirect to your blog you have to put in the correct URL. For example, if my blog address is http://stramaxon.blogspot.com my feed URL for Google reader should be
https://www.google.com/reader/view/feed/http://stramaxon.blogspot.com/feeds/posts/default
Now copy and paste the URL in your browser's address bar and Google reader page will open with all your post feed from the blog address you provided. Your old memories are back, yay!

Get XML version of your blog feed

Using Google reader you can also retrieve the blog's feed in XML format, it's not human readable but you saving those XML files on your computer you can view it offline using an XML file viewer. It's very useful if you want to transfer all those blog posts to a blog. Let's see how can we do it :

It's same as fetching the post using the feed URL on Google reader, this is also done by using reader but we will access the atom feed of the blog. The URL is:
https://www.google.com/reader/atom/feed/http://yourblog.blogspot.com/feeds/posts/default?n=1000
Just remember to change yourblog.blogspot.com in the address to your blog address.
The n parameter at the end of URL tells the server to return the number of posts defined, in this case it's set to 1000, but if you had more post to restore than that change it to a desired value.

For example I want to retrieve about 200 post from my blog stramaxon.blogspot.com, the URL I need to use would be
https://www.google.com/reader/atom/feed/http://stramaxon.blogspot.com/feeds/posts/default?n=200
Change the URL so it redirects to your blog's feed and load it into a browser, you will see a page with XML markup, right click on the page and click "save as..", save it on your computer as an XML file.
Import it to a blog
These XML files are very useful, you can import it into another blog. To do it in blogger, follow these steps :
  1. Log into your blogger account 
  2. Use the dropdown menu next to your blog title and go to the Settings menu
  3. Go to the Other tab under Settings 
  4. On that page, click on Import Blog under Blog Tools
  5. A popup box will appear, click on Choose/Browse File and browse to the XML file you downloaded and click Import Blog to upload the file. 
  6. Great! Now all the post in that XML file would be uploaded to the blog and you can publish it all with one click. 
It was that easy! Now you know how to restore deleted posts.