Thursday, February 18, 2010

How to display ads within the blog posts

Displaying Ads inside the post body is very useful and fruitful.

Step 1 :

Convert your code into a format that can be embedded into the template.

For doing this refer to this Tutorial and comeback for step 2.

Step 2 :

Go to Dashboard -> Layout -> Edit HTML and select Expand Widget Templates checkbox.

Now search for the following code.

<div class='post-body entry-content'>
<data:post.body/>

If you want to display your ads above the post then paste your converted ad code above <data:post.body/> .

If you want to display your ads below the post then paste your converted ad code below <data:post.body/> .

For example the following code displays an ad (Adsense Link List 468 x 60) just below the post title and above the post body.

<div class='post-body entry-content'>
<br/>
<script type="text/javascript"><!--
google_ad_client = "pub-4854525402780069";
google_ad_host = "pub-1556223355139109";
google_ad_host_channel="00000";
/* 468x15, created 5/1/09 */
google_ad_slot = "7063396771";
google_ad_width = 468;
google_ad_height = 15;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br/><br/>
<data:post.body/>

I will let you know the best ad sizes, colors and placements in my further posts.

You are free to use this tip as per your requirements. Happy Blogging...

0 comments:

Post a Comment