前言介紹
- 這款 WordPress 外掛「Highlight Search Terms」是 2009-04-13 上架。
- 目前有 8000 個安裝啟用數。
- 上一次更新是 2024-04-04,距離現在已有 393 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.7 以上版本才可以安裝。
- 外掛要求網站主機運作至少需要 PHP 版本 5.6 以上。
- 有 40 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
ravanh |
外掛標籤
mark | hilite | search | Highlight | Search Terms |
內容簡介
這款WordPress外掛能夠在搜索結果頁面上和每個與搜索結果相關聯的文章頁面上突出顯示搜索詞。該外掛輕量且沒有任何選項。它起初是與Thaya Kareeson的《如何使用jQuery突出顯示搜索詞 - 主題hack》和Ryan Boren的Search Hilite插件簡單融合而成。現在進化為具有多種優化、HTML5和bbPress支持的插件。自從1.6版本以來,它不再依賴jQuery庫。
特點:
點擊通過高亮: 不僅在WP搜索結果頁面上進行高亮,也可以從任何找到的頁面中更深入地進行一次點擊。
字符和大小寫不敏感(寬大)突顯顯示
BuddyPress / bbPress兼容:在論壇搜索中進行突顯顯示
快取(WP Super Cache)兼容
用雙引號包裹的搜索詞現在被視為單詞
它是做什麼的?
這個低影響力的插件在搜索結果頁面上找到所有搜索詞,並將它們與 ... 標籤一起突出顯示在每篇文章內部。
請注意,N是從0開始的數字,表示搜索短語中使用的第一個詞,每增加1個詞就會增加1。搜索短語中用引號括起來的任何部分都被視為單個詞。
它不能做什麼嗎?
沒有為突出顯示設置CSS樣式規則。您可以自由地使用任何您喜歡的樣式,但是要使在不支持HTML5的瀏覽器中顯示突顯顯示,如Internet Explorer 8或更老的版本,您絕對需要定義至少一個規則。
現代HTML5瀏覽器將使用它們自己的突顯顯示風格,通常是黃色標記劃線背景。
我需要做什麼?
在大多數情況下,它應該可以正常工作。但是,您可以采取兩件事情來確保向後瀏覽器和主題兼容:
定義CSS規則:沒有配置選項且沒有預定義的高亮樣式。您完全可以在主題的主樣式表(style.css)或WordPress主題自定義選項卡中定義任何CSS樣式規則。
您可以在FAQ中找到基本的說明和CSS示例。
檢查您的主題:在大多數最新的主題(包括WP的自帶主題)中,帖子和頁面內容顯示在帶有class「hentry」的div中。這意味著在帖子和頁面內容中找到的搜索詞會被突出顯示,但在頁面標題、側邊欄或頁腳中意外顯示的類似詞不會被突出顯示。
如果您目前的主題不使用class「hentry」,則此插件將尋找ID「content」、「main」,最後是「wrapper」,但如果找不到這些ID,則不會在您的主題上正常工作。請參閱FAQ中的最後一部分以了解使其運作的方法。
可用的鉤子和過濾器
hlst_query_vars - 插件將識別為搜索查詢的WordPress查詢變量數組。必須返回一個數組。默認值:['search_terms','bbp_search'](WordPress和bbPress搜索)
hlst_input_get_args - 插件將識別為搜索查詢的GET變量數組。必須返回一個數組。默認值:['hilite'](用於單擊通過高亮)
原文外掛簡介
Highlights search terms within WordPress generated search results, both on the search results page and on each linked post page itself.
This plugin is light weight and has no options. It started as very simple fusion between How to Highlight Search Terms with jQuery – theme hack by Thaya Kareeson and Search Hilite by Ryan Boren. It has since evolved with many optimizations, HTML5 and bbPress support.
Since version 1.6 it no longer depends on the jQuery library.
Features
Click through highlights: Highlights not only on WP search results page but also one click deeper inside any of the found pages
Character and case insensitive (lenient) highlighting
BuddyPress / bbPress compatibility: highlighting within forum searches
Caching (WP Super Cache) compatibility
Search terms wrapped in double quotes now considered as single term
What does it do?
This low impact plugin finds all search terms on a search results page inside each post and highlights them with a ... tag.
Note that N is a number starting with 0 for the first term used in the search phrase increasing 1 for each additional term used. Any part of a search phrase wrapped in quotes is considered as a single term.
What does it NOT do?
There are no CSS style rules set for highlighting. You are free to use any styling you wish but to make the highlights visible in browsers that do not support HTML5 like Internet Explorer 8 or older you absolutely need to define at least one rule.
Modern HTML5 browsers will use their own highlighting style by default, which usually is a yellow marker style background.
So what do I need to do?
In most cases, it should just work. But you can do two things to ensure backward browser and theme compatibility:
Define CSS rules: There are no configuration options and there is no predefined highlight styling. You are completely free to define any CSS styling rules in your themes main stylesheet (style.css) or the Custom CSS tab if the WordPress theme customizer.
You can find basic instructions and CSS examples in the FAQ’s.
Check your theme: In most up to date themes (including WP’s own default theme) post and page content is shown inside a div with class hentry. This means search terms found in post and page content will be highlighted but not similar terms that accidentally show in the page header, sidebar or footer.
If your current theme does not use the hentry class (yet), this plugin will look for IDs content, main and finally wrapper but if none of those are found, it will not work for you out of the box. See the last of the FAQ’s for ways to make it work.
Available hooks and filters
hlst_query_vars – The array of WordPress query variables that the plugin will identify as a search query. Must return an array. Default: ['search_terms','bbp_search'] (WordPress abd bbPress search)
hlst_input_get_args – An array of GET variables that the plugin will identify as a search query. Must return an array. Default: ['hilite'] (for click-through highlighting)
hlst_selectors – The array of possible HTML DOM element identifiers that the script will try. The first viable identifier it finds elements of will be scanned for search terms to mark, the rest is ignored. So the order is important here! Start with the element closest to, but still containing all the post/page title, excerpt or content.
hlst_events – The array of DOM event listeners that the inline script will watch for. Default: ['DOMContentLoaded','post-load'] (on Document Ready and for Jetpack Infinite Scroll and others).
hlst_inline_script – The inline script that will be added to the plugin script file. Can be used to add to or alter the inline script. Must return a string.
Known issues & development
If your theme does not wrap the main content section of your pages in a div with class “hentry” or HTML5 article tags, this plugin might not work well for you out of the box. However, you can make it work. See the last of the FAQ’s for an explanation.
Josh pointed out a conflict with the ShareThis buttons plugin. Since then, that plugin has been completely rewriten so please let me know if the problem still exists. Thanks!
Please file bug reports and code contributions as pull requests on GitHub.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Highlight Search Terms」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 1.3 | 1.4 | 1.5 | 1.2.2 | 1.2.3 | 1.2.4 | 1.2.5 | 1.3.9 | 1.4.1 | 1.4.2 | 1.4.3 | 1.4.4 | 1.4.5 | 1.4.6 | 1.4.7 | 1.5.1 | 1.5.2 | 1.5.3 | 1.5.4 | 1.5.5 | 1.5.6 | 1.5.7 | 1.5.8 | 1.6.1 | 1.7.0 | 1.8.2 | 1.8.3 | trunk |
延伸相關外掛(你可能也想知道)
String locator 》當你在開發主題和外掛時,你經常會注意到某些文字被硬編碼在文件中,你需要對其進行修改,但你不知道該主題或外掛的名稱,更不知道要查找哪個文件。, 你可以...。
WP-Syntax 》WP-Syntax 提供乾淨的語法突顯,使用 GeSHi,支援多種流行的語言,包括有或沒有行號的語法突顯,可以在從瀏覽器中複製程式碼片段時保持格式。, 它通過運行早...。
Prismatic 》唯一的 3 合 1 語法高亮插件!, 使用 Prism.js、Highlight.js 或純文字轉義顯示美麗的程式碼片段:, , Prism.js – 使用 Prism.js 轉義和語法高亮, Highlight....。
Highlight and Share – Social Text and Image Sharing 》在您的內容中與您的讀者見面。, 當用戶與您的文字互動時,顯示社交網絡選項(了解 Highlight and Share 如何工作)。, Highlight and Share 具有以下主要功能...。
Custom Highlight Color 》許多裝置和瀏覽器在選擇網站上的文字時提供不太理想的顏色。使用者可能出於習慣閱讀,或是想分享引言等各種原因選擇文字。此外掛可讓您在自訂檢視器中進行即...。
CodeColorer 》CodeColorer 是一個外掛程式,它可以讓您在文章中插入代碼片段並添加漂亮的語法高亮效果。, 此外掛程式基於 GeSHi庫建立,支援大多數語言。CodeColorer 的各...。
Code Prettify 》此外掛為自定版的Code Prettify library,支援本地樣式和腳本。此外掛會自動為頁面上的所有
標籤應用代碼高亮。, 支援古騰堡,且不會將您鎖定在特...。
Tooltipy (tooltips for WP) 》, 此外掛可讓你自動建立適應性工具提示方塊,以解釋專有名詞,讓使用者更舒適地瀏覽網站。, 使用簡碼詞彙表 [kttg_glossary]。, , , 展示, , 實際展示, 管理...。
Text Selection Color 》Text Selection Color 外掛可幫助輕鬆更改網站中已選取文字的顏色。, 功能:, , 使用者可透過外掛設定頁面中的顏色選擇器變更文字顏色和文字背景顏色。, 變更...。
Just Highlight 》Just Highlight 是一個 WordPress 外掛,可用於在文章或頁面中突顯文字,讓您輕鬆創建突顯閱讀者真正關心的內容的美觀文章。, 如何使用?, * 使用游標選擇...。
Featured Post with thumbnail 》這個外掛可以讓你在網誌的側邊欄中的任何地方添加一個區域,專門用於突出顯示你想要強調呈現的文章。它的使用非常簡單:安裝和啟用後,你可以決定將哪些文章...。
WP-GeSHi-Highlight — rock-solid syntax highlighting for 259 languages 》• 現場示範, • 亮點:, , 支援259種程式語言。, 適用於行動裝置:無需執行JavaScript,與基於JavaScript的解決方案相比可節省頻寬和電力。, 後端負載接近零。...。
Mark New Posts 》突顯 WordPress 文章的未讀狀態。, 功能:, , 開箱即用, 提供四種不同的標記方式突顯文章:, , 文字標籤(新!), 橘色圓圈, 圖片, 旗幟圖示, , , 可選擇當何...。
WP SyntaxHighlighter 》這個外掛是一個基於Alex Gorbatchev的SyntaxHighlighter ver. 3.0.83和2.1.382的程式碼語法加亮工具。, 功能特點, , 基於Alex Gorbatchev的"SyntaxHighl...。
Highlight Author Comments 》Highlight Author Comments 外掛能讓文章作者的評論以獨特的樣式顯示,無需編輯模板檔案等步驟。您只需要提供少量 CSS 樣式片段即可應用到作者評論上。, 版本...。