[WordPress] 外掛分享: genius 404

首頁外掛目錄 › genius 404
WordPress 外掛 genius 404 的封面圖片
10+
安裝啟用
★★★☆☆
3/5 分(1 則評價)
4006 天前
最後更新
問題解決
WordPress 2.6+ v1.0 上架:2015-03-31

內容簡介

拯救您的訪客免受無用的 404 錯誤!

不要讓訪客在到達不存在的內容時馬上放棄,而是努力猜測他們最初需要的內容。此外掛會使用來自
請求 URL 的關鍵字,在您的文章、頁面、標籤和分類中進行搜索。如果有匹配的,則重定向到該內容,而不是顯示錯誤。如果有多個匹配,則
404 模板可以使用一些範本標籤向訪客提供建議列表。

範本標籤

genius404_has_suggestions

如果有建議,則返回 true,否則返回 false

genius404_get_suggestions

檢索用於手動呈現的文章對象數組。

genius404_suggestions

列出建議文章的清單。

將參數「list」傳遞給函數,以列表方式呈現建議。

genius404_loop

查詢用於循環使用的文章。例如:

<?php genius404_loop(); ?>
<?php while (have_posts()) : the_post(); ?>
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<?php the_excerpt(); ?>
<?php endwhile; ?>

請注意,此循環無法正確顯示頁面,因為它不支持它們。如果您使用上述循環,不建議啟用頁面搜索。

genius404_get_search_terms

檢索用於填充建議列表的搜索詞組數組,供上下文突出顯示等使用。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「genius 404」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Save your visitors from unhelpful 404 errors!
Instead of quickly giving up when a visitor reaches content that doesn’t exist, make an effort to guess what they were
after in the first place. This plugin will perform a search of your posts, pages, tags and categories, using keywords from the requested
URL. If there’s a match, redirect to that content instead of showing the error. If there’s more than one match, the
404 template can use some template tags to provide a list of suggestions to the visitor.
Template tags
genius404_has_suggestions
Returns true if there are some suggestions, false otherwise
genius404_get_suggestions
Retrieve an array of post objects for rendering manually.
genius404_suggestions
Draw a list of suggested posts.
Pass the parameter “list” to render suggestions as a list.
genius404_loop
Query posts for use in a Loop. Eg:


Note that the loop will not display pages correctly, as it is not built to support them. It is recommended that if you use
a loop like that above, do not enable searching of pages.
genius404_get_search_terms
Retrieve an array of search terms used to populate the suggestions list, for use with contextual highlighting, etc.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon