How to Display Elements (Ads) Only On (Or Only Not At) Individual Single Post Item View如何顯示元素(廣告) ,只(或只有不)個別單一郵政項目的看法
Blogger.com, a popular free blog publishing service from Google, has a extremely easy to use and convenient template system that allows users to design the blog user interface presentations by selecting a theme and then drag and drop various page elements such as poll, newsreel, video bar, feed, label, logo, AdSense, HTML/JavaScript and more to align them according to users’ preference on blog layout. blogger.com後,受歡迎的免費博客出版服務由Google提供,有一個非常易於使用和方便的模板系統,允許用戶設計的博客用戶界面介紹選擇一個主題,然後拖放各種網頁元素,例如民意調查,新聞短片,視頻酒吧,飼料,標籤,標識, AdSense的的HTML / JavaScript和更使他們根據用戶的喜好對博客佈局。 However, it also comes with serious limitations, such as when you want to make certain elements (ie Google AdSense ad unit) to appear and show when visitors visit single post item individually, or just want to shown the widget component block on homepage, archive and label or category pages.然而,它也具有嚴重的局限性,例如當您想要讓某些要素(即Google AdSense廣告的單位)出現並顯示,當訪客造訪的單一項目後單獨,或者只是想表明,該Widget組成阻滯對網頁,存檔和標籤或類別的頁面。
Blogger.com allows users to manually the XML-based template HTML, thus allows a hack which enables users to manually edit the HTML code to achieve the aim to display and show certain widgets or part of webpages on individual post page view only. blogger.com允許用戶以手動方式基於XML的模板,從而允許黑客使用戶以手動編輯HTML代碼,以便達到目的,以顯示和顯示某些widgets或部分網頁就個別帖子頁只查看。 However, you have need to have a basic HTML knowledge to modify the HTML code of Blogger’s template, which as editable by clicking on Template tab (or Layout of the blog you want to change if at Dashboard), and then click on Edit HTML .不過,您有需要有一個基本的HTML知識,要修改的HTML代碼Blogger的範本,作為編輯按一下模板標籤(或佈局的博客您想要變更的,如果在儀表板) ,然後按一下編輯HTML格式 。
The trick is show a widget in single post item view only is to add the following two lines of code to the top and bottom of the code block respectively:訣竅在於顯示窗口小部件在單一項目後的看法,不僅是要添加以下兩行代碼,頂部和底部的代碼塊分別是:
<b:if cond='data:blog.pageType == "item"'> <b:if cond='data:blog.pagetype == "item"'>
</b:if> < /乙:如果>
The above lines will add in a condition which value is negative is the blog is not showing individual post content page.上述線路將增加在一個條件,其中的價值是否定的是博客是不會顯示個別文章內容網頁。 Thus anything that are wrapped inside it won’t be shown on homepage, label or category pages, or archive pages.因此,任何包裹內將不會出現在網頁上,標籤或分類網頁,或存檔的頁面。 For example, while例如,雖然 wrapping the AdSense ads manually beside the post content包裝AdSense廣告手動旁張貼內容 , you can make the ads displayed only when individual posts are viewed by adding above 2 lines to the code, so that it will has the following structure: ,您就可以讓顯示的廣告,只有當個別職位來看,加入上述二行代碼,因此,它將具有以下的結構:
<b:if cond='data:blog.pageType == "item"'> <b:if cond='data:blog.pagetype == "item"'>
Parsed Google AdSense Ad Code (guide to剖析Google AdSense廣告代碼(指南 parse the HTML code of AdSense JavaScript with escape character解析HTML代碼的AdSense的JavaScript與轉義字符 ) )
</b:if> < /乙:如果>
To display the page elements or ad units on every pages except individual post content view pages, wrap the following lines of code instead:以顯示該網頁的內容或廣告的單位對每一個網頁,除個別職位內容查看的頁面,總結下列幾行代碼:
<b:if cond='data:blog.pageType != "item"'> <b:if cond='data:blog.pagetype != "item"'>
</b:if> < /乙:如果>
The above statements make use of conditional statements similar to IF, ELSE, END IF in most programming languages.上述報表使用條件語句類似,如果,否則,如果年底,在大多數的編程語言。 The Blogger XML support these three conditional statements too. Blogger的XML支持這三個條件語句。 Two already been used above, with the third one ELSE is <b:else>.二已經被用來以上,與第三人是<b:else> 。 You can make use of <b:else> to instruct Blogger template to display this widget (eg AdBrite ads) on all pages except single post pages, and show another widget (eg AdSense ads) on individual post pages.您可以使用<b:else>指示Blogger模板,以顯示這個窗口小部件(例如adbrite廣告)的所有網頁上,除單一的帖子頁,顯示另一窗口小部件(例如, AdSense廣告)就個別後的頁面。
Other than ads code or JavaScripts that are manually inserted into Blogger HTML, the above trick can be applied to widget based page elements that are added to the layout.以外的其他廣告代碼或javascripts是手動插入到Blogger的HTML ,上述的伎倆,可用於小裝置為基礎的網頁內容,都被添加到佈局。 But you need to study carefully the HTML code to identify which blocks of code is the element in order to add in above codes to wrap on top and bottom around them.但您需要仔細研究的HTML代碼,以確定哪些塊代碼是元素,以添加在上述守則,以總結對頂部和底部靠近他們。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要說明 :這是一個機器翻譯網頁是“按原樣”提供的擔保。 Machine translation may be difficult to understand.機器翻譯可能很難理解。 Please refer to請參閱 original English article英文原版的文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at分享和貢獻,或取得技術的支持和幫助,在 My Digital Life Forums 我的數字生活論壇 . 。
Related Articles相關文章
- Move Blogger Inline Ads Between Posts to Inside Within Post Position動議的Blogger內插廣告之間的員額內後的立場
- How to Wrap AdSense Ads Around and Inline Beside Blogger Post Content如何總結AdSense廣告約和內置旁邊的Blogger帖子內容
- Place AdSense Ad Unit In Various Positions Inside Within Blogger Post Contents地方AdSense廣告單元在各個據點內的Blogger帖子內容
- Retrieve and Get WordPress Post ID Outside the Loop as PHP Variable檢索和獲取的WordPress張貼ID以外的迴路作為PHP變量
- Change to ads about Feature in Google Adsense Ads改變廣告約功能在Google AdSense廣告
- Video Ads Support in Google Adwords and Adsense視頻廣告支持,在Google的AdWords和AdSense
- Adding Extra More Fields to WordPress Write/Edit Post/Page Right Column加入額外的更多領域的WordPress寫/編輯帖子/頁右邊一欄
- Trick to Add AdSense, AdBrite and Other JavaScript Ad Code Directly to Blogger HTML Template伎倆AdSense新增, adbrite和其他JavaScript廣告代碼直接到Blogger HTML模板
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working paginating或分裂的WordPress郵寄或網頁下一頁在WordPress沒有工作
- Add and Insert to Put Google AdSense Ads Units Between Blog Posts in Blogger.com新增和插入把Google AdSense廣告單位之間的博客帖子在blogger.com



















October 3rd, 2007 01:17 2007年10月3日1時17分
[...] Note that you can also make the ads appear only on single post view. [ … … ]注意,您也可以使廣告只會出現在單一的工作地點的看法。 [...] [ … … ]
November 5th, 2007 02:20 2007年11月5日2時20分
Thanks.謝謝。 That helped.幫助。
January 2nd, 2008 16:45 2008年1月2日16時45分
Do u have any idea how the same thing can be done using the classic template in blogger?做u有任何想法如何同一件事可以做使用經典模板在Blogger嗎?
The if condition to check for?如果該條件,以檢查?
January 13th, 2008 01:32 2008年1月13日1時32分
I used我用
(if(in_category(CATID)) (如果( in_category ( catid ) )
{ (
} )
Works great偉大的工程
April 11th, 2008 01:29 2008年4月11日1時29分
I’ve tried but code is automatically set to:我試過,但代碼會自動設定為:
test display 測試顯示
My aim is to display “test display” only on homepage.我的目標是要顯示“測試顯示, ”只有對網頁。
May 6th, 2008 22:19 2008年5月6日22時19分
Hi,嗨,
I like to play with html, and location of adsense on my blogs.我喜歡玩的HTML ,和位置的AdSense對我的Blog 。 I chanced upon your post and implemented the code to appear on a single post. i偶然後,您的文章並實施了代碼出現在一個單一的工作地點。 Then I got a new template and I had to start all over again.So now I have bookmarked your post, for future reference.然後我得到一個新的模板和我開始,所有超過again.so現在我已書籤您的文章,以供日後參考。 Great post.偉大的職位。
May 30th, 2008 02:30 2008年5月30日2時30分
this is what i looking for.這是我在尋找。 thanks for help.感謝您的幫助。
August 16th, 2008 23:54 2008年8月16日23時54分
Thanks a lot..this trick is very useful to me..感謝了很多..這一招是非常有益的,我..