|
|
- Go to ‘Layout’ > ‘Edit HTML’ > Tick ‘Expand Widget Templates’
- Fin this code: <data:post.body/>
- Just before this code, paste your Google AdSense code
- Also note that you may need to parse the code first before you can use in the template. Use this tool: http://www.blogcrowds.com/resources/parse_html.php to make the code compatible.
- Your code will look like this:
<script type="text/javascript"><!--
google_ad_client="pub-3896524625048375";
google_ad_host="pub-1556223355139109";
google_ad_width=336;
google_ad_height=280;
google_ad_format="336x280_as";
google_ad_type="text_image";
google_color_border="FFFFFF";
google_color_bg="FFFFFF";
google_color_link="D27318";
google_color_url="008000";
google_color_text="560E00";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script> - After your code has been parsed, copy it to put in the following format:
<div align="center">
<table border="0" cellpadding="0" align="left">
<tr>
<td align="center">
<p align="center">
put Google ads Here
</p>
</td>
</tr>
</table>
</div>
Replace ‘put Google ads Here’ with your parsed code. - Click ‘SAVE TEMPLATE’
Note: If you just want to show this ad only in single post, use this code: <b:if cond='data:blog.pageType == "item"'> PUT ALL YOUR ABOVE CODE HERE </b:if>
So the final code may look like this:
<b:if cond='data:blog.pageType == "item"'>
<div align="center">
<table border="0" cellpadding="0" align="left">
<tr>
<td align="center">
<p align="center">
<script type="text/javascript"><!--
google_ad_client="pub-3896524625048375";
google_ad_host="pub-1556223355139109";
google_ad_width=336;
google_ad_height=280;
google_ad_format="336x280_as";
google_ad_type="text_image";
google_color_border="FFFFFF";
google_color_bg="FFFFFF";
google_color_link="D27318";
google_color_url="008000";
google_color_text="560E00";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</p>
</td>
</tr>
</table>
</div>
</b:if>
Alternative code you can use:
<div class='post-body entry-content'>
<b:if cond='data:blog.pageType == "item"'>
<div style='float: left;'>
<script type="text/javascript"><!--
google_ad_client = "pub-xxxxxxxxxxxxxxxx";
google_ad_host = "pub-xxxxxxxxxxxxxxxx";
google_ad_slot = "xxxxxxxxxx";
google_ad_width = 336;
google_ad_height = 280;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js&;quot;>
</script>
</div>
</b:if>
<p><data:post.body/></p>
SAMPLE:
If you have any better method, please share with us!
0 comments:
Post a Comment