Title: Similar Posts Ontology
Author: cfischer83
Published: <strong>2015 年 1 月 11 日</strong>
Last modified: 2025 年 12 月 16 日

---

搜索插件

![](https://ps.w.org/similar-posts-ontology/assets/banner-772x250.jpg?rev=1462844)

![](https://ps.w.org/similar-posts-ontology/assets/icon-256x256.jpg?rev=1462844)

# Similar Posts Ontology

 作者：[cfischer83](https://profiles.wordpress.org/cfischer83/)

[下载](https://downloads.wordpress.org/plugin/similar-posts-ontology.2.1.zip)

 * [详情](https://cn.wordpress.org/plugins/similar-posts-ontology/#description)
 * [评价](https://cn.wordpress.org/plugins/similar-posts-ontology/#reviews)
 *  [安装](https://cn.wordpress.org/plugins/similar-posts-ontology/#installation)
 * [开发进展](https://cn.wordpress.org/plugins/similar-posts-ontology/#developers)

 [支持](https://wordpress.org/support/plugin/similar-posts-ontology/)

## 描述

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:

    ```
    <?php
    $args = array (
        'posts_per_page' => 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.

## 屏幕截图

[⌊You can define how your widget looks from the widget admin/edit screen.⌉⌊You can
define how your widget looks from the widget admin/edit screen.⌉[

You can define how your widget looks from the widget admin/edit screen.

[⌊You can have it output as a simple list like other, typical side-bar widgets.⌉⌊
You can have it output as a simple list like other, typical side-bar widgets.⌉[

You can have it output as a simple list like other, typical side-bar widgets.

[⌊Or you can add fields and your own styles to really make it stand out (this example
is found at www.bluecrayon.net)⌉⌊Or you can add fields and your own styles to really
make it stand out (this example is found at www.bluecrayon.net)⌉[

Or you can add fields and your own styles to really make it stand out (this example
is found at www.bluecrayon.net)

## 安装

 1. Upload `similar-posts-ontology` to the `/wp-content/plugins/` directory
 2. 通过WordPress的的“Plugins”菜单激活插件
 3. If you want the widget, go to ‘Appearance’ -> ‘Widgets’ and look for Similar Posts
    Ontology widget. If you prefer to call programmatically, use the pk_related_return
    function in your theme.

## 常见问题

### How does this plugin work?

There are two aspects to it. First, it finds all similarly tagged, categorized, 
and otherwise taxonomically created content
 on your site, then sorts it by what
has the most similarities. Second, if there is a tie between two posts it will give
the edge to the newest content, or content posted closer to the time your current
post was posted, depending how you configure it.

### Why Ontology? What’s an Ontology?

Ontology is the study of the nature of ‘being’. This plugin uses the ontological
philosophy of determining an entities
 placement within its own ‘type’ by studying
the entities relationships.

### Why am I not seeing any content when I install this?

You can use this in two ways. Either by calling pk_related_return() in your theme
or by placing the widget on your site.
 If you are using the widget, remember that
it only works on any “single” page (where is_single() would return true). The pk_related_return()
can theoretically work anywhere as long as you provide a proper post ID. Try var_dump()
with pk_related_return() and look at the description for proper usage of this function.

### Why are my results coming back with weird content that I wouldn’t expect?

This issue may be your taxonomies. The content for which you’re trying to find related
content needs to have tags,
 categories, and/or custom taxonomies. Also, to properly
find your content, tags/categories/taxonomies must be used on the _related_ content
as well. The more you intentionally use your tags and categories, the better your
results set will be.

## 评价

![](https://secure.gravatar.com/avatar/590c1a85322729f2345aa128684db6522b37951ea328215b6f501ed8439c0a91?
s=60&d=retro&r=g)

### 󠀁[Hidden Gem !!!](https://wordpress.org/support/topic/hidden-gem-7/)󠁿

 [Jimmy Lee](https://profiles.wordpress.org/shirtguy72/) 2018 年 5 月 4 日

Most of the highly installed Related Post Plugins are forgive me: "A TRAIN-WRECK"
So nice to have found this little well coded beauty … THANKS!!! 100 STARS!!!

![](https://secure.gravatar.com/avatar/447211e2c4568ea0002942347bc1cf84f379aa976086eaae6f70666981f5350c?
s=60&d=retro&r=g)

### 󠀁[Perfect for my posts](https://wordpress.org/support/topic/perfect-for-my-posts/)󠁿

 [jaymharley1989b](https://profiles.wordpress.org/jaymharley1989b/) 2016 年 10 月
31 日

This is perfect and seems to have a strong algorithm that correctly picks which 
items should appear first. It even made me realize something was wrong with my own
tags when I thought 'hey, why isn't this post showing up in related posts?' and 
I realized I'd forgotten to put my tags on that post! The widget is powerful and
gives you lots of options, although I found it only works on is_single() pages, 
but you can use its handy pk_related_return function to put it right into any part
of your theme if you know your post ID. Highly recommended!

 [ 阅读所有2条评价 ](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/)

## 贡献者及开发者

「Similar Posts Ontology」是开源软件。 以下人员对此插件做出了贡献。

贡献者

 *   [ cfischer83 ](https://profiles.wordpress.org/cfischer83/)

[帮助将「Similar Posts Ontology」翻译成简体中文。](https://translate.wordpress.org/projects/wp-plugins/similar-posts-ontology)

### 对开发感兴趣吗?

您可以[浏览代码](https://plugins.trac.wordpress.org/browser/similar-posts-ontology/)，
查看[SVN仓库](https://plugins.svn.wordpress.org/similar-posts-ontology/)，或通过
[RSS](https://plugins.trac.wordpress.org/log/similar-posts-ontology/?limit=100&mode=stop_on_copy&format=rss)
订阅[开发日志](https://plugins.trac.wordpress.org/log/similar-posts-ontology/)。

## 更新日志

#### 2.1

_Release Date – July 31st, 2016_
 * Include some base styles to look better with
common theme conventions * Fixed bug where author URL was broken * Tested up to 
4.6

#### 2.0

_Release Date – August 15th, 2015_
 * Optimized query to allow for the option of
specifying sorting preferences.

#### 1.0.1

_Release Date – January 11th, 2015_
 * Made the widget include HTML and classes 
that are best practice.

#### 1.0

_Release Date – January 10th, 2015_
 * First Version

## 额外信息

 *  版本 **2.1**
 *  最后更新：**10 月前**
 *  活跃安装数量 **50+**
 *  WordPress 版本 ** 4.0.0 或更高版本 **
 *  已测试的最高版本为 **6.9.10**
 *  语言
 * [English (US)](https://wordpress.org/plugins/similar-posts-ontology/)
 * 标签
 * [articles](https://cn.wordpress.org/plugins/tags/articles/)[content](https://cn.wordpress.org/plugins/tags/content/)
   [posts](https://cn.wordpress.org/plugins/tags/posts/)[related](https://cn.wordpress.org/plugins/tags/related/)
   [similar](https://cn.wordpress.org/plugins/tags/similar/)
 *  [高级视图](https://cn.wordpress.org/plugins/similar-posts-ontology/advanced/)

## 评级

 5 星（最高 5 星）。

 *  [  2 条 5 星评价     ](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/?filter=5)
 *  [  0 条 4 星评价     ](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/?filter=4)
 *  [  0 条 3 星评价     ](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/?filter=3)
 *  [  0 条 2 星评价     ](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/?filter=2)
 *  [  0 条 1 星评价     ](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/?filter=1)

[您的评价](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/#new-post)

[查看全部评论](https://wordpress.org/support/plugin/similar-posts-ontology/reviews/)

## 贡献者

 *   [ cfischer83 ](https://profiles.wordpress.org/cfischer83/)

## 支持

有话要说吗？是否需要帮助？

 [查看支持论坛](https://wordpress.org/support/plugin/similar-posts-ontology/)