2011/12/30

How to insert ads into Blogger XML code

First you need to parse your code into an XML format Blogger can  understand. You can simply use the HTML code you got from your affiliate program.

Parse the code here:

http://www.blogcrowds.com/resources/parse_html.php

Copy the parsed code.

That’s basically it. You can look for patterns in the HTML code where you want to put your ad. Make sure to check for <div> endings and test. Always backup.

To post the add in the body of your post read on.

On your blogger account, go and edit the HTML code (I don’t have to tell you to make a backup of it first before you edit the code).

Go to Layout – Edit HTML. Make sure to check “Expand Widget Templates” option.

Look for this code which represents a single post:
<p><data:post.body/></p>

Then just paste the parsed ad code before or after that code. Save and see how it looks like. You can place your code between some <div> tags if you want to design it further (eg: center, left flush, etc).

No comments:

Post a Comment