Saturday, July 6, 2013

How to add 'Share Buttons' to the Post in Blogger [with code]

Leave a Comment
As now we have customized our blog a lot, I don't recommend going to Layouts and editing the 'Blog Posts' widget there to add the share buttons. Though, if you haven't made any customization to the Template HTML, that's the easiest way to go.

** Make sure you backup your template before you make this change to it

1. Log in to your blogger account and open the blog that you want to edit
2. Go to 'Template' on the left.
3. Click on 'Edit HTML'. This will open the entire blogger template code for editing
Remember last time we had edited the code for <b:include data='post' name='post'/>.
4. Now we need to find the last instance of following code.
<b:include data='post' name='post'/>
</b:if>
Note that there might be multiple copies of these lines and we need to find the last one.
5. We need to insert the following code below it
<b:if cond='data:blog.pageType == &quot;static_page&quot;'>
    <b:include data='post' name='shareButtons'/>
</b:if>
<b:if cond='data:blog.pageType == &quot;item&quot;'>
    <b:include data='post' name='shareButtons'/>
</b:if>
6. Make sure it looks like this. Then click 'Save Template'.


0 comments:

Post a Comment