Friday, May 4, 2012

Move the AddThis Widget to Post Footer in Blogger

Lately I've been doing a minor template makeover on my main blog. One of the changes I made was replacing the default Blogger share buttons with the AddThis toolbar.

An issue I found with the default code was that the widget was being inserted on top of the post footer box instead of inside it like so:


Here is how to alter the code to have the widget placed inside of your post footer.

Go to your dashboard > layout > and Edit the HTML/Javascript widget

Find the following line of code near the bottom:

    container.insertBefore(n,footer);

and change it to this:

    footer.childNodes[1].insertBefore(n,footer.childNodes[1].firstChild);

And the widget should appear in your post footer like below:


To get the widget to appear after the first line use this code instead:

    footer.childNodes[1].appendChild(n);

And it will show up like this:


Hopefully someone will find this useful.

No comments:

Post a Comment