Blogtrottr
海芋小站
提供實用軟體教學,介紹有趣網站及資訊,豐富電腦人生 
Continuous Deployment Tool

Automate from SCM to Production with BuildMaster! 100+ Integrations; Free for 5 Users.
From our sponsors
如何在 Blogger 特定頁面不顯示 Google Adsense 廣告
Jul 11th 2014, 08:57, by 張海芋

Blogger 是一個很方便的部落格系統,而許多人用他寫網誌,有些網誌內容難免會引發違反 Google Adsense 的疑慮,如果為了一個頁面違規而讓你被 Google 停權,這也太悲慘了。所以,如果是 Blogger 的站長,其實只要加加程式碼,就可以讓你在特定頁面阻擋 Google 廣告了。

在特定頁面阻擋 Google Adsense 廣告的方式很簡單,假設有一個頁面不需要顯示廣告,只要在「不顯示廣告的網址1換成你的不顯示廣告網址就可以了

1
2
3
4
5
6
7
8
<b:if cond='data:blog.canonicalUrl != &quot;不顯示廣告的網址1&quot;'>
 
<div style='margin: 10px 0px 10px 0px;'>
 
Google Adsense 廣告程式碼 .......
 
</div>
</b:if>

而如果有第三個、第四個、第五個…更多個呢?其實很簡單,只要在多加幾個條件判斷式來過濾即可。

1
2
3
4
5
6
7
8
9
<b:if cond='data:blog.canonicalUrl != &quot;不顯示廣告的網址1&quot;'>
<b:if cond='data:blog.canonicalUrl != &quot;不顯示廣告的網址2&quot;'>
<div style='margin: 10px 0px 10px 0px;'>
 
Google Adsense 廣告程式碼 .......
 
</div>
</b:if>
</b:if>
1
2
3
4
5
6
7
8
9
10
11
<b:if cond='data:blog.canonicalUrl != &quot;不顯示廣告的網址1&quot;'>
<b:if cond='data:blog.canonicalUrl != &quot;不顯示廣告的網址2&quot;'>
<b:if cond='data:blog.canonicalUrl != &quot;不顯示廣告的網址3&quot;'>
<div style='margin: 10px 0px 10px 0px;'>
 
Google Adsense 廣告程式碼 .......
 
</div>
</b:if>
</b:if>
</b:if>

相信聰明的你,一定有找到相關的規則了,而關於 Blogger 的語法,可以參考海芋寫過的「完全解析 Blogger 程式碼」一文

留言回應 或者 訂閱 RSS feed 以獲得更多的文章更新資訊。若有商業上的需求,也歡迎透過 合作提案 與我聯絡。本站文章非經授權請勿「全文轉貼」,引用時請註明來源,謝謝。

Related

This entry passed through the Full-Text RSS service — if this is your content and you're reading it on someone else's site, please read the FAQ at fivefilters.org/content-only/faq.php#publishers.

You are receiving this email because you subscribed to this feed at blogtrottr.com.

If you no longer wish to receive these emails, you can unsubscribe from this feed, or manage all your subscriptions
arrow
arrow
    全站熱搜

    xals2q 發表在 痞客邦 留言(0) 人氣()