Google AdSense 廣告併排作法分享
by 資訊藝術家 • 2009/05/20 • adsense, Blog, Google • 0 Comments
在文章頁裡面顯示 Google 廣告且併排的方法
常常看到很多前輩的 Blog 的文章頁面都可以讓 Google 的大廣告併排出現
如下圖
我就下定決心要好好的研究一翻 ~~ 總算被我找到方法了 ~~ 在這邊公開跟大家分享 !!
找到類似下面程式的地方 !!
<div class='post-body> . . </div>
之間用這些取代
<b:if cond='data:blog.pageType == "item"'> <div> <table border='0' width='620'> <tr> <td width='300'> <script type='text/javascript'> google_ad_client = "pub-4122239292938506"; google_ad_host = "pub-1599271086004685"; /* 300x250, 已建立 2009/5/15 */ google_ad_slot = "9347390447"; google_ad_width = 300; google_ad_height = 250; </script> <script src='http://pagead2.googlesyndication.com/pagead/show_ads.js' type='text/javascript'> </script> </td> <td width='300'> <script type='text/javascript'> google_ad_client = "pub-4122239292938506"; google_ad_host = "pub-1599271086004685"; /* 300x250, 已建立 2009/5/15 */ google_ad_slot = "6271271077"; google_ad_width = 300; google_ad_height = 250; </script> <script src='http://pagead2.googlesyndication.com/pagead/show_ads.js' type='text/javascript'> </script> </td> </tr> </table> <p> <data:post.body/> </p> </div> <b:else/> <b:if cond='data:blog.homepageUrl == data:blog.url'> <data:post.body/> </b:if> </b:if>
這樣就可以出現像上面的廣告一樣囉 ~~ 而且只有在文章頁有喔 ~~ 主頁是不會出現的 ~~
當然做任何修改前請先備份喔 ~~