This post is mainly in reply to a comment from a fellow blogger Shankar Ganesh which read
And I have a question: how did you hack the code to display Adsense units under each post header only when a particular post link page is loaded?
The basic idea behind the Ad placement is the correct usage of
“<MainPage> </MainPage>” “<MainOrArchivePage> </MainOrArchivePage>” and “<Itempage> </Itempage>”
(no quotes required) tags provided by blogger. Any thing you put inside these tags will appear only on ‘MainPage,’ ‘Main and ArchivePage’ and ‘Post Page’ respectively. You can use this to specify any piece of code to appear only on the above pages. So basically my code appears like this
<!– Begin #main-content –>
<div id=”main-content”>
<Blogger>
<!– Ad header only on Main or Archieve Page–>
<MainOrArchivePage>
JAVASCRIPT FOR THE LINK UNIT ON MAIN AND ARCHIVE PAGE HERE
</MainOrArchivePage>
<BlogDateHeader>
<h2 class=”date-header”><$BlogDateHeaderDate$></h2>
</BlogDateHeader>
<!– Begin .post –>
<div class=”post”><a name=”<$BlogItemNumber$>”></a>
<BlogItemTitle>
<h3 class=”post-title”>
<BlogItemUrl><a href=”<$BlogItemUrl$>” title=”external link”></BlogItemUrl>
<$BlogItemTitle$>
<BlogItemUrl></a></BlogItemUrl>
</h3>
</BlogItemTitle>
<ItemPage>
JAVASCRIPT FOR ADSENSE 468×90 RECTANGLE HERE
</ItemPage>
And this will tell you how I did this. I used the full code so that all can understand it easier.



