Search This Blog

23 Dec 2013

How To Add A Widget Below First Post In Blogger

Tutorial [教程] • 23 DECEMBER 2013
This tutorial will show you how to make a gadget/widget to appear just below the first Blogger post. First, you must understand that the usual gadgets provided by Blogger can be added only in the areas where the design section permits. Still, we can show any element, for example, an AdSense ad, an image, a flash file, a video etc.

Adding An Element Below First Post 

Step 1. First, go to your Blogger Template and click on the Edit HTML button:

Step 2. Check the "Expand Widget Templates" box:

Step 3. And find this line:

 <b:include data='post' name='post'/>

How to get the code ? 

Example : 
I want my widget to post below the blog, I get the widget code from from Layout and not your template! Sometimes you have to parse the widget code in order to work (go to Google Adsense Converter).
The widget code should be the one that you usually add to Layout > Page Elements. 

Step 4. Just below it add this code:

 <b:if cond='data:post.isFirstPost'>
<div align="center" style="margin-top:0px; margin-bottom:10px;">
Here goes the code of the element you want to show</div>

- The bolded text indicates to where you should paste the code of the element (eg. AdSense ad, a widget).

- In red are the top margins (margin-top) and the bottom margins (margin-bottom), this is in case you want the element to move towards or away from the entries, also you can add any style like a background color, border etc..

Step 5. Preview to make sure everything is okay, then Save your Template.

Tutorial Credited to : Help Blogger


Template developed by Confluent Forms LLC; more resources at BlogXpertise