opensearch
Have you noticed when you visit some sites, there's a bluish glow in the search engine field in Firefox. Like this:
当您访问某些网站时,是否注意到了,Firefox的搜索引擎字段中发出蓝色的光芒。 像这样:
What does that even mean? Well, it means you can add this site's search to the drop down list of search engines. This functionality is following the open search standard.
那有什么意思? 好吧,这意味着您可以将本网站的搜索添加到搜索引擎的下拉列表中。 此功能遵循开放式搜索标准。
The things are actually pretty simple. You need to have an XML file <link>-ed to from your page.
事情实际上很简单。 您需要从页面上将XML文件<link> -ed链接到。
For example on this blog I have this in the head:
例如,在此博客中,我的头是这样的:
<link
rel="search"
type="application/opensearchdescription+xml"
href="http://www.phpied.com/wp-content/plugins/open-search/open-search-xml.php"
title="phpied.com : Search in posts"
/>
So how do you add open search capability to your blog? With the OpenSearch plugin for WordPress, naturally.
那么,如何为博客添加开放搜索功能? 自然地,使用适用于WordPress的OpenSearch插件。
BTW, if you're running PHP4 you might get errors during installation, in this case just open up the open-search-class.php and
顺便说一句,如果您正在运行PHP4,则在安装过程中可能会出错,在这种情况下,只需打开open-search-class.php并
- replace all "public static" with empty string用空字符串替换所有“公共静态”
- replace all "private static" with empty string 用空字符串替换所有“专用静态”
- replace all "self::" with "OpenSearch::" 用“ OpenSearch ::”替换所有“ self ::”
This is it, enjoy and if you want to change the default icon, you need to look into replacing the image found in /wp-content/plugins/open-search/default-favicon.png
就是这样,请尽情享受,如果您想更改默认图标,则需要研究替换在/wp-content/plugins/open-search/default-favicon.png
找到的图像
Here's what you get at the end:
这是最后的结果:
And now your readers can add your search to their browser and quickly find content on your blog. Sweet.
现在,您的读者可以将搜索添加到他们的浏览器中,并快速在博客上查找内容。 甜。
Tell your friends about this post on Facebook and Twitter
在Facebook和Twitter上告诉您的朋友有关此帖子的信息
opensearch