Latest

16 Aug 2013

How To Center Align Your Adsense Code Under Post Title in Post Pages

Recently, I changed the positions of my adsense codes and it wasn't up to 2 hours, I started seeing the results on my adsense account. I decided to center align the code under my post title so that it will be in between the spaces before the body content. You can see this already in action above this post. In this post I will be showing you how you can center align your adsense code under the post title of your blog in the post pages.

There are two ways of doing this, is either you use the table format or you use the division format (Div). I used the table format to center align the codes above, you too use it or the second one.

How to Get Started:
First and foremost visit Adsense Parser Free Online Tool to parse your adsense code. When you finish parsing it, copy it and paste on a Notepad.

Center Aligning by Table format:

Login to Blogger Dashboard > Design > Edit HTML > Tick the Expand Widget and use CTR + F to find the code below
                                                   <p><data:post.body/></p>

Directly above <p><data:post.body/></p>, copy and paste the table format code below

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div class='ads'>

<table align="center"><tr><td>GOOGLE ADSENSE CODE</td></tr></table>

</div>
</b:if>

Replace GOOGLE ADSENSE CODE with the adsense code you parsed and pasted on Notepad.
Save your template and view a post on your blog.

Center Aligning by Div format:

Login to Blogger Dashboard > Design > Edit HTML > Tick the Expand Widget and use CTR + F to find the code below
                                                   <p><data:post.body/></p>

Directly above <p><data:post.body/></p>, copy and paste the Div format code below

<b:if cond='data:blog.pageType == &quot;item&quot;'>
<div class='ads'>
<div align="center">  GOOGLE ADSENSE CODE </div>
</div>
</b:if>

Again replace  GOOGLE ADSENSE CODE with the adsense code you parsed and pasted on Notepad.
Save your template. That's all!