前言介紹
- 這款 WordPress 外掛「Similar Posts Ontology」是 2015-01-10 上架。
- 目前有 50 個安裝啟用數。
- 上一次更新是 2024-11-15,距離現在已有 169 天。
- 外掛最低要求 WordPress 4.0.0 以上版本才可以安裝。
- 有 2 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
posts | content | related | similar | articles |
內容簡介
你的網站有使用分類和標籤嗎?你有使用自訂分類嗎?如果是,這個外掛程式會根據你所有的分類找到類似的內容。
顯示相關的文章有兩種方式:
第一種是使用提供的小工具在文章中顯示相關內容,這只適用於‘is_single()’為true的情況。
第二種是使用‘pk_related_return($post->ID);’函數,在需要的地方進行程式設計呼叫。
這個外掛程式提供的小工具可以讓你選擇要顯示的文章數量,還有欄位選項有:特色圖片、作者、日期和摘要(標題是必需的)。你可以決定要顯示哪種特色圖片:縮略圖、中等大小、大型或完整尺寸,版本2.0以上,你現在可以決定‘類似文章’排序是新的文章還是與現在這篇文章創建日期更接近的文章。
如果你發現小工具不能滿足你的需求,或者選擇太少,你可以使用以下函數來進行程式設計:
pk_related_return($post->ID, $args);
其中,$post->ID是要顯示相關文章的文章ID。
$args參數是一個陣列,你可以使用以下的值(更多的值很快就會推出):
posts_per_page(int預設值為5)
thumbnail_size(字符串,包含這些值之一:“thumbnail”, “medium”, “large”, “full”。預設為縮略圖)
sort_prefer(字符串,包含這些值之一:“newest”, “closest”。預設為最新)
例如:
$args = array (
'posts_per_page' => 6,
'thumbnail_size' => 'medium',
'sort_prefer' => 'closest'
);
pk_related_return的返回值是一個對象陣列,其中包括WordPress文章表中的大部分欄位,還有永久鏈接和特色圖片。
未來的功能:
允許使用者在請求中只指定某些內容類型(文章、頁面、自訂),這樣你就可以只返回產品或者只返回文章。這只有在不同內容類型之間分享分類時才會有問題。
原文外掛簡介
Does your website utilize categories and tags? Does it use custom taxonomies? If so, this plugin will find similar content
based on all your taxonomies. There are two ways to show related posts within your page.
The first way to show related content on your post is to use the widget provided. This only works when is_single() is true
The second way to show similar content on your site is to use the pk_related_return($post->ID); function which can be
called programmatically anywhere you wish!
The Widget included with this plugin gives you the option to limit the amount of posts; it allows you to determine which
fields to show: Featured Image, Author, Date, and Excerpt (Title is required); it allows you to determine which
variant of the featured image to show: thumbnail, medium, large, or full. As of version 2.0, you can now decide whether the
‘similar posts’ sorting prefers posts that are newer or posts that were created closer to the date of the post you’re
viewing.
If you find the Widget doesn’t meet your needs or is too limiting, you can call the functionality programmatically using
this function:
pk_related_return($post->ID, $args);
Where $post->ID is the ID of the post for which you are wanting to show related articles.
The $args parameter is an array with the following values available to you (more coming soon):
posts_per_page (int defaults to 5)
thumbnail_size (string consisting of one of these values: “thumbnail”, “medium”, “large”, “full”. Defaults to thumbnail).
sort_prefer (string consisting of one of these values: “newest”, “closest”. Defaults to newest).
An example might be:
6,
'thumbnail_size' => 'medium',
'sort_prefer' => 'closest'
);
The return value of pk_related_return is an array of objects that includes most of the fields within WordPress’s posts
table plus permalink and featured image.
Future Additions:
Allow the user to specify only certain content types (posts, pages, custom) in a request. This would allow you to specify
only products get returned, or only blog posts. This would only be an issue if content types share taxonomies.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Similar Posts Ontology」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 2.0 | 2.1 | 1.0.1 | trunk |
延伸相關外掛(你可能也想知道)
WP 404 Auto Redirect to Similar Post 》歡迎使用 WP 404 Auto Redirect to Similar Post!本外掛會根據標題、文章類型及分類來自動將 404 頁面重新導向至類似文章。如果找不到類似文章,訪客會被重...。
Post-Plugin Library 》Post-Plugin Library 是一個共享代碼庫,並沒有獨立的功能,必須安裝它才能為 Similar Posts、Recent Posts、Random Posts、Popular Posts 和 Recent Comment...。
M Similar Posts 》此外掛提供相似或相關的文章清單,可應用於任何文章或自訂文章類型內容。, 此列表可以以以下方式添加:, , Gutenberg 區塊, 短代碼, 小工具, , 如果您在側邊...。
Simple Shortcode Similar Post 》這個外掛提供了更好的方法,在文章中設置相似的文章。, 你只需要設置一個短代碼,就可以使用這個外掛來設置相似的文章。。
Admin Title Check 》Admin Title Check 在 WordPress 經典編輯器新增和編輯文章頁面的標題欄位中,增加了額外的標題檢查功能。如果在標題欄位打入4個或更多的字符將會觸發標題檢...。
Suggest 404 links 》總結:這款 WordPress 外掛的目的是在 404 頁面上向訪客通知 WordPress 無法解析當前的 URL,但卻讓訪客困惑。訪客可能不清楚頁面是被刪除還是連結未正確輸入...。
Recmnd 》Recmnd 可以讓您向讀者顯示相關的內容。建議是即時的,當您更新內容或發布新文章時,建議會改變。所有建議均通過小部件提供,您可以控制其風格、每個建議顯示...。
Loptix 》Loptix 顯示來自 Loptix 網路的最新文章。, Loptix 是一個免費的連結分享/流量網路。。
LH Related Posts by Taxonomy 》透過在文章內容底部添加相關文章,快速提高讀者的參與度。, 相同詞彙最多的文章將會顯示在前面!, 此外,此外掛能夠在多種分類和文章類型中找到相關的文章。...。