外掛說明
WP Remote Site Search 是一款使用 WP REST API 傳回任何 WordPress 網站資料的搜尋外掛。
基本使用方式
啟用 WP Remote Site Search 外掛,然後新增短代碼 [wp_remote_site_search]
至頁面或任何可以顯示的位置。
選項
以下是 WP Remote Site Search 目前可用的短代碼清單。
1. 設定搜尋目標遠端網站網址:remote_url="https://example.com"
URL from where you want to fetch the informaion
The remote site should have WordPress 4.7 or higher or Rest API (v2) plugin installed to get the search results.
2. 搜尋方塊標題:title="搜尋常見問題集"
Title for the search box
3. 要進行搜尋的指定分類:category_id="1,2"
You can also pass "category_id1,category_id2" to search multiple posts from multiple categories.
4. 是否搜尋指定分類的子分類:sub_categories="true"
You can also get all reslts from categories (category_id1, category_id2) and their respective subcategories by setting sub_categories="true".
5. 搜尋框內的預留位置文字:placeholder="請輸入搜尋關鍵字"
The text displayed in the search box placeholder. Default is "Search...".
6. 要搜尋的內容類型代稱:type="books"
Default type is posts,
You can add custom post type also.
7. 搜尋結果預設顯示數量:max_results="50"
Total Number of results you want to display.
(default max_results is 30)
8. 在搜尋結果下方顯示 HTML 格式內容:html_input="<button>保持聯絡</button>"
Append html after all results get displyed.
完整短代碼範例:
[wp_remote_site_search remote_url="https://example.com" category_id="1,2" sub_categories="true" type="books" title="How can we help?" placeholder="Have a question? Enter a search term." max_results="30" html_input="<button>Get In Touch!</button>"]
致謝名單
WP Live Search
授權方式:GNU GPL 第 2 版或更新版本
外掛說明頁
安裝方式
- 前往 [安裝外掛] 頁面。
- 點擊 [上傳外掛]。
- 從個人裝置中選取
wp-remote-site-search.zip
。 - 點擊 [立即安裝]。
- 啟用外掛。
常見問題集
-
外掛運作方式
這個外掛透過短代碼執行。請將 [wp_remote_site_search remote_url=”https://example.com”] 短代碼新增至需要的文章或頁面中,並參考以上選項。 -
外掛環境需求
要進行搜尋的遠端網站必須是 WordPress 4.7 或更新版本,或安裝 REST API (v2) 外掛以取得搜尋結果。
參與者及開發者
變更記錄
1.0.4
- Improvement – Compatibility to WordPress 5.6.
1.0.3
- Improvements: Enqueue scripts only where shortcode is used.
1.0.2
- Search result design improvements.
1.0.0
- Initial release