Google has some useful tips on how to optimize the use of Google Adsense on one's web pages. No surprise - the hottest "hot spot" for the best click-through returns lies right in the middle of your content.
How does one place a Google Adsense ad (or any other ad, bit of text, or image for that matter) between entries on the main index page of your MT weblog? By using a simple trick of the "lastn" and "offset" attributes outlined in the MT manual section on Displaying Entries.
Normally on your Main Index template, you would have your MTEntries section laid out like so (MT3.2):
<MTEntries> <$MTEntryTrackbackData$> <MTDateHeader><h2 class="date-header"><$MTEntryDate format="%x"$></h2></MTDateHeader> <a id="a<$MTEntryID pad="1"$>"></a> <div class="entry" id="entry-<$MTEntryID$>"> <h3 class="entry-header"><$MTEntryTitle$></h3> <div class="entry-content"> <div class="entry-body"> <$MTEntryBody$> . . . </MTEntries>
To put a Google Adsense ad after the first entry shown (the most recent entry) and before the second entry, make a copy of all of your
<MTEntries> code and paste it right after the first chunk of code. Add the attribute
lastn="1" to the first
<MTEntries> tag like so:
For the second block of MTEntries code, add the attribute
lastn="x" where x equals the number of entries you would like to show on your main blog index page, minus one, and add the attribute
<MTEntries lastn="6" offset="1">
Save and rebuild your Main Index template before moving on to the next step to make sure it's working.
Next, add your Google Adsense code between the two blocks of MTEntries code like so:
Save and rebuild your template.
- How to add Google Adsense to RSS feeds - an explanation by Dave Taylor