Integrate and Display Google AdSense for Search and Co-Op Custom Search Engine Results in WordPress Blog Page Template整合和展示谷歌的AdSense搜索和合作社自定義搜索引擎結果在WordPress的博客頁面模板
Google AdSense for Search features the ability to let web publishers to open and display search results within the website itself.谷歌的AdSense搜索功能的能力,讓網站發布開放和顯示搜索結果的網站本身。 In other word, the results of a user search performed in Google AdSense for Search box will appear within a frame on a page from the site, so that rather the users need not to leave the publishers’ websites and being taken to Google, while still able to search for information with Google web search.在其他詞,結果用戶的搜索在谷歌表演AdSense for search框將出現在一個框架網頁上的網站,使用戶,而無需離開出版商的網站,並正在採取的谷歌同時還能夠搜索信息與谷歌的網絡搜索。 Beside, Google AdSense for Search, Google Co-op also has Custom Search Engine that can be placed and integrated, together with the search results into website, and comes with more customization options such as search refinements, ads positioning, prioritize or limit sites to include in search results, change and modify the look and feel, collaboration with users, ability to create multiple search engine, make money with AdSense, and of course, ability to integrate into existing website and blog templates.旁邊,谷歌的AdSense搜索,谷歌的Co - op也有自定義搜索引擎可放置和綜合,連同搜索結果進入網站,並配備更多的定制選項,如搜索優化,廣告定位,優先或限制網站包括在搜索結果中,變更和修改的外觀和感覺,與用戶合作,能夠創建多個搜索引擎,賺錢與AdSense ,當然,有能力融入現有的網站和博客的模板。
To integrate, incorporate, embed and display Google search results from Google AdSense for Search and Google Co-Op Custom Search Engine within the template and theme of WordPress blog, we use the similar steps that used to為了整合,納入嵌入並顯示谷歌的搜索結果從谷歌的AdSense搜索和谷歌的Co - op自定義搜索引擎的模板和主題的WordPress的博客,我們會使用類似步驟,用來 integrate and embed Amazon aStore into WordPress集成和嵌入亞馬遜到WordPress的aStore blog by using additional Page template.博客使用更多的頁面模板。 You can embed the search results code snippets on a new post if you want to display search results based on your WordPress theme’s Post template.您可以嵌入在搜索結果代碼段上了一個新的哨所如果你想顯示搜索結果根據您的WordPress的主題的郵政範本。 However, as Post doesn’t allow you to select a unique custom template for a single post, you will have the same layout among all the post entries and search results.然而,隨著郵政不允許你選擇一個獨特的自定義模板為一個單一的工作,你都會有相同的佈局各條目後和搜索結果。 This is not advisable, as sidebar may take up a lot of space, and the theme’s Post template has contains AdSense ads itself or other customisation that will make the embedded search results appear odd.這是不可取的,因為欄最多可能需要大量的空間,並為主題的郵政模板包含AdSense廣告本身或其他定制,使嵌入式搜尋結果會出現奇怪的。 So using a new Page template is better choice, and the Google search results can be made display on WordPress itself without any need of plugin.因此,使用新的頁面模板是更好的選擇,以及谷歌的搜索結果可以顯示在WordPress的本身沒有任何需要的插件。
To embed, integrate and display Google search displays from Google AdSense for Search and Google Co-Op Custom Search Engine in WordPress blog, try the following steps.嵌入,整合和展示谷歌搜索顯示來自谷歌的AdSense搜索和谷歌的Co - op自定義搜索引擎在WordPress的博客,嘗試以下步驟。
- Sign up for註冊 Google AdSense谷歌的AdSense or或 Google Co-Op Custom Search Engine谷歌的Co - op自定義搜索引擎 . 。
- When generate the Google AdSense search box code or Google Co-Op Custom Search Engine (CSE) search box code, remember to select “Open results within my own site” (Google AdSense for Search under Opening of search results page section) or “Host a search box and search results on your own site” (CSE under Add this search engine to your website section).當產生谷歌的AdSense搜索框代碼,或谷歌的Co - op自定義搜索引擎(的CSE )搜索框代碼,請記住選擇“打開結果在我自己的網站” (谷歌的AdSense for Search下開幕的搜索結果頁部分)或“主機搜索框和搜索結果放在自己的網站“ (自定義搜索引擎根據購買此搜索引擎到您的網站,一節) 。
Key in the URL of the page on your site that the search results will appear.關鍵的網址網站上的網頁搜索結果將會出現。 For WordPress page without page parent, the URL should look like this: http://www.yourdomain.com/page-title/ (ie http://www.mydigitallife.info/google-search/).對於WordPress的網頁頁面的父母,網址看起來應該如下: http://www.yourdomain.com/page-title/ (即http://www.mydigitallife.info/google-search/ ) 。 Note: trailing slash is insignificant, and can be dropped.注:斜線是微不足道的,可下降。 - You can do any other customization of your personal Google search engine, such as color, logo, style, layout, language, Google domain’s country, sites to include, and etc. However, it’s out of the scope of this article.你可以做任何其他定制您的個人谷歌的搜索引擎,如顏色,標識,風格,佈局,語言,谷歌的域名的國家,包括網站,等等,但不在本文的討論範圍之。
- After customizing the search box, generate and get the search box code and search results code.經過定制的搜索框,創造並獲得搜索框代碼和搜索結果的代碼。 (You must have both code, if not your configuration of search box is wrong.) (您必須有兩個代碼,如果不是您的配置搜索框是錯誤的。 )
- Create a custom page template for Wordpress based on your existing Page template.創建自定義網頁模板, WordPress的基礎上您現有的網頁模板。 You may retain or drop the sidebar (<?php get_sidebar(); ?> line), as sidebar may take up a lot of your webpage space.您可以保留或放棄欄“ ( < ?的PHP get_sidebar ( ) ; ? ”線) ,作為補充工具欄可能會採取了很多您的網頁空間。 If so you will need to adjust the width of search results accordingly during configuration and customisation of search box.如果是這樣的話你將需要調整的寬度相應的搜索結果中的配置和定制的搜索框。 Beside, as Wordpress templates are heavily aligned and positioned by using CSS DIV tags, you may need to remove DIV in CSS layout that restrict the width (if you remove the sidebar) or modify the structure of the layout in your Google search results page template.旁邊,因為WordPress的模板非常贊同和定位用的CSS除法標記,您可能需要刪除除法在CSS佈局,限制寬度(如果您刪除欄)或修改的結構佈局中的谷歌搜索結果頁模板。 Generally, a Google Search search results page template without sidebar would like similarly like this (comments on template code in italic, can be safely ignored):一般而言,谷歌搜索的搜索結果頁模板沒有欄同樣要像這樣(評論模板代碼中斜體,可以放心地忽略不計) :
<?php “ ?的PHP
/* / *
Template Name: Search Results Page模板名稱:搜索結果頁
*/ * /
?> ? “
The above section is important so that Wordpress will identify the new theme’s php file as a Page template. 上述節是重要的,以便WordPress的將確定新的主題的PHP文件作為頁面模板。 You can change the template name though. 您可以更改模板名稱雖然。<?php get_header(); ?> “ ?的PHP get_header ( ) ; ? ”
In Wordpress theme’s header, there may be also DIV tag that controls the width in the Page layout. 在WordPress的主題標題,可能會有還除法標記,控制寬度在頁面佈局。 If it’s the case, the remove this line, the copy and paste the everything from Header template, and modify accordingly. 如果它的情況下,刪除此行,複製並粘貼從頭模板,並修改相應的。<div class=”content”> <div class="content">
Again, this may restrict the width of layout, if so, replace it with your own DIV structure, or simply with <center></center> (which I used) or just remove the line. 同樣,這可能會限制寬度的佈局,如果是這樣,取而代之的是您自己的除法結構,或乾脆與<center> “ /中心” (我用) ,或只是刪除該行。<!– Google Search Result Snippet Begins –> “ ! -谷歌搜索結果摘錄開始- >”
<div id=”googleSearchUnitIframe”></div> <div id="googleSearchUnitIframe"> “ /專區”<script type=”text/javascript”> <script type="text/javascript">
var googleSearchIframeName = ‘googleSearchUnitIframe’;葉googleSearchIframeName = ' googleSearchUnitIframe ' ;
var googleSearchFrameWidth = 700;葉googleSearchFrameWidth = 700 ;
var googleSearchFrameborder = 0 ;葉googleSearchFrameborder = 0 ;
var googleSearchDomain = ‘www.google.com’;葉googleSearchDomain = ' www.google.com ' ;
</script> “ /腳本”
<script type=”text/javascript” “腳本類型= ”文/ javascript中“
src=”http://www.google.com/afsonline/show_afs_search.js”>源= “ http://www.google.com/afsonline/show_afs_search.js ” “
</script> “ /腳本”
<!– Google Search Result Snippet Ends –> “ ! -谷歌搜索結果摘錄完- >”Replace above line with your own Google search results code (not Google search box code). 將上述符合自己的谷歌搜索結果代碼(不是谷歌搜索框代碼) 。
</div> “ /專區”
If you don’t use any DIV above, just remove this line too. 如果你不使用任何除法以上,只需刪除此行了。 If you use <center>, replace with </center>. 如果您使用<center> ,改為“ /中心” 。<?php get_footer(); ?> “ ?的PHP get_footer ( ) ; ? ”
Note: You can also exclude the theme’s header and footer (basically mean empty template file just just a line of search results code, which will display only search results, but that defeat the purpose of integration with Wordpress.注:您還可以排除主題的頁眉和頁腳(基本上意味著空模板文件只是一個系列的搜索結果代碼,這將只顯示搜索結果,但失敗的目的,結合WordPress的。
- Save the new page template for your WordPress theme.保存新的一頁模板為您的WordPress的主題。 You can give it any name.你可以給它的任何名稱。
- Upload the new page template with search results code to your Wordpress theme’s directory.上傳新的一頁模板搜索結果代碼到您的WordPress的主題的目錄。 So if you’re using Blogsome or Wordpress.com, you may be out of luck.所以,如果你使用的是Blogsome或Wordpress.com ,您可能就運氣不佳。
- Create a new Wordpress static Page by clicking on “Write” then “Write Page”.創建一個新的WordPress的靜態頁面點擊“收件” ,然後“收件頁” 。
Key in Title as what you enter for URL to display search results during setup of Google search box above (eg if you enter /google-search/ as URL for search results page, you will need to enter Google Search as page title).關鍵詞在標題為你輸入的網址顯示搜索結果在安裝過程中的谷歌搜索框上面(例如,如果您輸入/谷歌搜索/作為網址,搜索結果頁,您將需要輸入谷歌搜索的頁面標題) 。 You page-slug has to be exactly the same with the URL entered as shown in image below.您的網頁彈了完全一樣的網址進入顯示在圖像下面。 - On the Page Template at the side, choose Search Results Page (or whichever name you gave to the new template).網頁上的模板在一邊,選擇搜索結果頁(或兩者的名字你給的新模板) 。
- Save and publish the page.保存並發布網頁。
- Edit your template, and put in the search box code to anywhere you like the search box to appear.修改您的模板,並在搜索框代碼,以任何你喜歡的搜索框出現。
- The search results from Google is now integrated with WordPress blog.搜索結果由谷歌目前正在與WordPress的博客。 Whenever a user search with the Google search box from AdSense or Custom Search Engine, the search results will appear within your WordPress blog.每當用戶搜索與谷歌搜索框從AdSense或自定義搜索引擎,搜索結果將會出現在您的WordPress的博客。
For sample of integration and inline search results display in WordPress blog by Google AdSense for search, simply use the search box on top.對於樣品的一體化和內置的搜索結果顯示在WordPress的博客由谷歌的AdSense for search ,只需使用搜索框上。 For Google Co-Op Custom Search Engine, check out對於谷歌的Co - op自定義搜索引擎,檢查 Google Medical Search Engine谷歌醫學搜索引擎 . 。
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相關文章
- Which Search Engine is the Best and Most Relevant?其中搜索引擎是最好的和最相關?
- Force Firefox to Open Search Box Originated Result Page in New Blank Tab部隊的Firefox打開搜索框起源結果頁在新的空白標籤
- Technorati Incoming Links Plugin for WordPress Technorati的傳入聯繫WordPress的插件
- Windows Live Search Review by PC World Windows Live搜索進行審查PC世界
- Paginating or Split WordPress Post or Page with NextPage in WordPress Not Working Paginating或斯普利特WordPress的郵政或與下一頁頁在WordPress的不工作
- Add NoFollow Relationship to WordPress Blogroll to Increase PageRank新增NoFollow關係WordPress的博客增加的PageRank
- Check Web Page Strength In Term of Search Engine Optimization檢查網頁力量在任期內搜索引擎優化
- Replace Google Blog Search with Technorati for Incoming Links in Dashboard of WordPress取代谷歌博客搜索與傳入Technorati的鏈接在控制台的WordPress的
- Kosmix Search Engine Kosmix搜索引擎
- Search with Google and Win Prizes from Blingo搜索與谷歌和贏取獎品從Blingo

































August 20th, 2007 05:26 2007年八月二十○日5點26分
I am trying to follow these instructions and am not having any luck with getting the results to appear on the search page.我想按照這些指示,我沒有任何運氣得到的結果顯示在搜索頁上。
I think I am not doing the static page bit right.我想我沒有做靜態頁面位權。 How do I make it a static page exactly?我如何使它成為一個完全的靜態頁面?
September 9th, 2007 04:37 07年9月9號04:37
This is my first post這是我的第一篇文章
just saying HI只是說音響
February 3rd, 2008 11:58 2008年二月3日11:58
i really like your ad layouts and of course on how to implement it in wordpress.org sites..我真的很喜歡您的廣告版面,當然就如何落實它在wordpress.org網站..
i hope you make them into wodpress plugins instead so that it will be easier.我希望你讓他們到wodpress插件不是如此,這將是更加容易。 I’m pretty sure your site will be more popular.我敢肯定你的網站將成為更受歡迎。
thanks感謝
May 10th, 2008 14:55 2008年5月10日14:55
Is there a way to keep a published page from showing up?是否有辦法保持出版頁顯示了嗎? My template uses wp_list_pages to display the top level pages in a menu, can i suppress my search results page?我國模板使用wp_list_pages顯示高層的網頁在一個菜單,我可以制止我的搜索結果頁?
June 12th, 2008 15:41二〇 〇八年6月12日15:41
[...] Integrate and Display Google AdSense for Search and Co-Op Custom To integrate, incorporate, embed and display Google search results from Google AdSense for Search and Google Co-Op Custom Search Engine within the template and theme of WordPress [...] [...]集成和顯示谷歌的AdSense搜索和合作社自訂整合,納入嵌入並顯示谷歌的搜索結果從谷歌的AdSense搜索和谷歌的Co - op自定義搜索引擎的模板和主題的WordPress的[ 。 .. ]
June 15th, 2008 19:02二〇 〇八年6月15日19:02
[...] cierto, y más allá del nuevo producto Google, recomiendo este pequeño paso a paso que me vino muy bien para poder integrar los resultados en el template de [...] [...] cierto ,與其他阿拉省新producto谷歌recomiendo埃斯特pequeño帕索1帕索你我比諾穆伊邊第電源integrar德洛斯結果稅金模板德[...]
August 14th, 2008 22:49 08年八月14日22:49
Buen artículo aunque las imágenes un poco borrosas.好artículo aunque拉斯圖片取消波蘇borrosas 。 Llevo semanas intentando embedir Adsense en el blog de mi web sin éxito, a ver si siguiendo esta técnica… Llevo semanas intentando embedir的Adsense恩報德美博客網站罪孽éxito ,一個市siguiendo查看此學校...