NP Rank:
How To: Place AdSense Ads In A Header at the Top of Your TypePad Blog
Rich Owings sent me a hack for putting AdSense Ads at the top of TypePad blogs. He based it on my tutorial here for top level navigation menus, and also
credits Gary at the Digital Point CSS forum, for helping with CSS. I'm
still not using AdSense, so I haven't tested this, but ou can an
example of how it looks at Rich's blog, GPS tracklog.To place AdSense ads at the top of your blog, follow the steps in the
extended post. You must have a TypePad Pro account and be using
advanced templates in order to use this Hack.Note: when altering your existing template code, it is a very good idea
to copy your code and paste it into a text document in case you make a
mistake and need to start from scratch. More tips on Code Hacking
Safety can be found here: 10 Tips for Working with Advanced Templates.Step One: Adding the CSS to Your Blog
- Click the Weblogs tab in TypePad and select the blog where you want to place AdSense ads.
- If you are already using an advanced template, click the Design tab. If you are using a Basic template follow these instructions to convert your template to advanced.
- Under Advanced Templates, Click on your Stylesheet file. Scroll all the way to the bottom and paste the following CSS code below where it says /* other css */.
#adsense {
padding-top: 5px;
padding-bottom: 5px;
height: 20px;
background-color: white;
text-align: center;
margin-left: auto;
margin-right: auto;
}- Change the background color and other values to suit your taste.
- Click Save at the bottom of the page.
Step Two: Create A Template Module for Your AdSense Header
- Near the bottom of the page, locate and click Create New Template Module.
- Give your new template a name of banner-header by typing it in the Template Name field.
- Paste the following code into the Template Body field.
- Generate code for a 728x15 AdSense link unit.
- Paste it into the Template Body between the and tags.
- Click Save at the bottom of the page.
Step Three: Including Your New banner-header Module into Your Templates
- Return to the Design tab for your blog.
- Click on your Main Index Template. Replace with
- Click Save.
- Return to the Design tab and click on your Archive Index Template.
- Replace with and click Save.
- Return to the Design tab and for each of the following templates Category Archives, DataBased Archives, and Individual Archives replace with Click Save for each one.
- You're done! Click Save and Republish your site (be sure that Publish all Files is selected in the popup window).
- 8. View your blog in a new tab or window. If you don't see the ads
at the top, hold the shift key down the first time you reload the page.



Comments (0)