[WordPress] 外掛分享: Random Post Plugin – Redirect URL to Post

首頁外掛目錄 › Random Post Plugin – Redirect URL to Post
WordPress 外掛 Random Post Plugin – Redirect URL to Post 的封面圖片
4,000+
安裝啟用
★★★★★
5/5 分(20 則評價)
280 天前
最後更新
問題解決
WordPress 4.9+ PHP 8.0+ v0.25.0 上架:2015-05-20

內容簡介

重定向您的訪客到:

隨機文章
您最新的文章
您最舊的文章
前一篇或下一篇文章
或一組條件的組合,例如最新的10篇文章中的隨機文章,至少3個月前的最新文章,或特定作者的最新文章。

功能 | 範例 | 文檔 | 最新開發部落格文章

一個神奇的URL帶您到正確的文章

此外掛提供了一個URL(連結),可直接帶您前往單篇文章檢視。此文章是由查詢參數?redirect_to=和其他可選參數來決定的。

當有人輸入此URL時,若可用的文章有更改,其URL將保持相同但目標會變更。這表示您可以在選單中使用相同的靜態URL、按鈕或電子報中使用,而此外掛會找出正確的目標。

只需將您的WordPress網站URL輸入瀏覽器中並加上?redirect_to=…即可。

redirect_to的可能值包括:

last或latest – URL將重新導向到最新的文章。
first或oldest – URL將重新導向到最舊的文章。
random – URL將重新導向到隨機文章。
prev或previous – URL將重新導向到上一篇文章(按日期)。
next – URL將重新導向到下一篇文章(按日期)。
custom – 依據強制性orderby參數和可選的order參數來決定文章。

您也可以透過其他篩選參數來限制考慮的文章範圍,例如&s=searchaword或&cat=2,或使用偏移量前往第二新的文章或上一篇文章之前的文章。random與count及bias結合可讓您選擇具有不同概率的最新(或最舊)文章。

緩存

此外掛提供資料庫結果的快取。

設定和參數

後端沒有設定頁面,您可以透過URL中的查詢參數來完全配置此外掛。

欲取得更多關於參數和疑難排解的資訊,請前往此外掛網頁。

URL的範例

注意:請以自己網站位置替換“http://www.example.com/”,空白要寫成“%20”。

http://www.example.com/?redirect_to=latest – 將重新導向至最新的文章

http://www.example.com/?redirect_to=random&pk_campaign=random – 將重新導向至隨機文章並追蹤訪問

http://www.example.com/?redirect_to=prev – 將重新導向至上一篇文章

http://www.example.com/?redirect_to=random&each_once=rewind – 將重新導向至隨機文章,避免與上一篇文章重複

外掛標籤

開發者團隊

⬇ 下載最新版 (v0.25.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Random Post Plugin – Redirect URL to Post」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Redirect your visitors to

a random post
your last (latest) post
your first (oldest) post
the previous or next post
or a combination of conditions, for example a random post among your last 10 posts, or the latest post from at least 3 months ago, or the latest post of a specific author.

Features | Examples | Documentation | Latest Development Blog Post
A magic URL takes you to the right post
This plugin provides a URL (link) that takes you directly to a post in single-post view. This post is determined by the query parameter ?redirect_to= and optional others.
While the URL remains the same, its target changes depending on the available posts at the time when somebody enters it. That means you can use the same static URL in a menu, with a button or in a newsletter and the plugin finds out the correct target.
Simply enter the URL of your WordPress site into your browser and add ?redirect_to=… to the end.
Possible values for redirect_to are:

last or latest – The URL will redirect to the last (latest) post.
first or oldest – The URL will redirect to the first (oldest) post.
random – The URL will redirect to a random post.
prev or previous – The URL will redirect to the previous post (by date).
next – The URL will redirect to the next post (by date).
custom – The post will be determined according to the mandatory parameter orderby and the optional parameter order.

You can also limit the scope of considered posts by additional filter parameters, such as &s=searchaword or &cat=2, or use an offset to go to the second latest or to the post before the previous. The parameter random combined with count and bias lets you pick the latest (or oldest) posts with a different probability than the rest.
Caching
The plugin offers caching of database results.
Settings and Parameters
There is no settings page in the backend. You configure the plugin entirely through the query parameters in the URL.
Please find more information about parameters and troubleshooting on the plugin website.
Examples for URLs
Note: Replace “http://www.example.com/” with your own website location. Spaces are written as “%20”.
http://www.example.com/?redirect_to=latest – redirects to the latest post
http://www.example.com/?redirect_to=random&pk_campaign=random – redirects to a random post and tracks the visit
http://www.example.com/?redirect_to=prev – redirects to the previous post
http://www.example.com/?redirect_to=random&each_once=rewind – redirects to a random post, avoiding duplicates, and then starts over again
http://www.example.com/?redirect_to=prev&offset=1 – redirects to the post before the previous post
http://www.example.com/?redirect_to=random&count=10 – redirects to a random post among the 10 latest posts
http://www.example.com/?redirect_to=random&count=10&bias=80 – redirects to a random post. The plugin picks one from the latest 10 with a probability of 80% and from the rest with a probability of 20%
http://www.example.com/?redirect_to=random&count=10&offset=1 – redirects to a random post among the 10 posts that come after the latest
http://www.example.com/?redirect_to=random&after=1%20month%20ago – redirects to a random post among the posts that are not older than 1 month
http://www.example.com/?redirect_to=latest&exclude=4,7 – redirects to the latest post, excluding the posts with the IDs 4 and 7
http://www.example.com/?redirect_to=latest&offset=1 – redirects to the second latest post
http://www.example.com/?redirect_to=custom&orderby=comment_count&order=DESC – redirects to the post with the most comments
http://www.example.com/?redirect_to=latest&s=iaido&default_redirect_to=12&cache=200 – redirects to the latest post that contains the word ‘iaido’ or, if nothing can be found, to the page or post with the ID 12; use a cache with a 200 second lifetime
Button
The plugin also provides a shortcode [redirect_to_post_button] to create a simple button. Some parameters are available.
A button that links to a random post is a great way to increase your visitors’ on-site engagement and therefore your SEO ranking!

(video by WPBeginner)
If you find this plugin useful, please give it a 5-star rating. Thank you!

延伸相關外掛

文章
Filter
Apply Filters
Mastodon