{"id":33899,"date":"2015-01-11T23:37:12","date_gmt":"2015-01-11T23:37:12","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/similar-posts-ontology\/"},"modified":"2025-12-16T05:36:24","modified_gmt":"2025-12-16T05:36:24","slug":"similar-posts-ontology","status":"publish","type":"plugin","link":"https:\/\/pcd.wordpress.org\/plugins\/similar-posts-ontology\/","author":8177914,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","version":"2.1","stable_tag":"2.1","tested":"6.9.4","requires":"4.0.0","requires_php":"","requires_plugins":null,"header_name":"Similar Posts Ontology","header_author":"Cory Fischer","header_description":"","assets_banners_color":"b178ae","last_updated":"2025-12-16 05:36:24","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"http:\/\/www.planetkodiak.com\/blog\/similar-posts","header_author_uri":"http:\/\/www.planetkodiak.com","rating":5,"author_block_rating":0,"active_installs":60,"downloads":3455,"num_ratings":2,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"cfischer83","date":"2015-01-11 23:37:12"},"1.0.1":{"tag":"1.0.1","author":"cfischer83","date":"2015-08-11 06:14:34"},"2.0":{"tag":"2.0","author":"cfischer83","date":"2016-03-31 03:04:34"},"2.1":{"tag":"2.1","author":"cfischer83","date":"2025-12-16 05:36:24"}},"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":"2"},"assets_icons":{"icon-128x128.jpg":{"filename":"icon-128x128.jpg","revision":1462844,"resolution":"128x128","location":"assets","locale":""},"icon-256x256.jpg":{"filename":"icon-256x256.jpg","revision":1462844,"resolution":"256x256","location":"assets","locale":""}},"assets_banners":{"banner-1544x500.jpg":{"filename":"banner-1544x500.jpg","revision":1462844,"resolution":"1544x500","location":"assets","locale":""},"banner-1880x609.jpg":{"filename":"banner-1880x609.jpg","revision":1462844,"resolution":"1880x609","location":"assets","locale":""},"banner-772x250.jpg":{"filename":"banner-772x250.jpg","revision":1462844,"resolution":"772x250","location":"assets","locale":""}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.0.1","2.0","2.1"],"block_files":[],"assets_screenshots":{"screenshot-1.jpg":{"filename":"screenshot-1.jpg","revision":1221443,"resolution":"1","location":"assets","locale":""},"screenshot-2.jpg":{"filename":"screenshot-2.jpg","revision":1065505,"resolution":"2","location":"assets","locale":""},"screenshot-3.jpg":{"filename":"screenshot-3.jpg","revision":1065505,"resolution":"3","location":"assets","locale":""}},"screenshots":{"1":"You can define how your widget looks from the widget admin\/edit screen.","2":"You can have it output as a simple list like other, typical side-bar widgets.","3":"Or you can add fields and your own styles to really make it stand out (this example is found at www.bluecrayon.net)"},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[5936,529,166,2663,12268],"plugin_category":[57],"plugin_contributors":[92515],"plugin_business_model":[],"class_list":["post-33899","plugin","type-plugin","status-publish","hentry","plugin_tags-articles","plugin_tags-content","plugin_tags-posts","plugin_tags-related","plugin_tags-similar","plugin_category-taxonomy","plugin_contributors-cfischer83","plugin_committers-cfischer83"],"banners":{"banner":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/banner-772x250.jpg?rev=1462844","banner_2x":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/banner-1544x500.jpg?rev=1462844","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/icon-128x128.jpg?rev=1462844","icon_2x":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/icon-256x256.jpg?rev=1462844","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/screenshot-1.jpg?rev=1221443","caption":"You can define how your widget looks from the widget admin\/edit screen."},{"src":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/screenshot-2.jpg?rev=1065505","caption":"You can have it output as a simple list like other, typical side-bar widgets."},{"src":"https:\/\/ps.w.org\/similar-posts-ontology\/assets\/screenshot-3.jpg?rev=1065505","caption":"Or you can add fields and your own styles to really make it stand out (this example is found at www.bluecrayon.net)"}],"raw_content":"<!--section=description-->\n<p>Does your website utilize categories and tags? Does it use custom taxonomies? If so, this plugin will find similar content\nbased on all your taxonomies. There are two ways to show related posts within your page.<\/p>\n\n<ul>\n<li>The first way to show related content on your post is to use the widget provided. This only works when is_single() is true<\/li>\n<li>The second way to show similar content on your site is to use the pk_related_return($post-&gt;ID); function which can be \ncalled programmatically anywhere you wish!<\/li>\n<\/ul>\n\n<p>The Widget included with this plugin gives you the option to limit the amount of posts; it allows you to determine which\nfields to show: Featured Image, Author, Date, and Excerpt (Title is required);  it allows you to determine which \nvariant of the featured image to show: thumbnail, medium, large, or full. As of version 2.0, you can now decide whether the\n'similar posts' sorting prefers posts that are newer or posts that were created closer to the date of the post you're\nviewing.<\/p>\n\n<p>If you find the Widget doesn't meet your needs or is too limiting, you can call the functionality programmatically using\nthis function:<\/p>\n\n<pre><code>pk_related_return($post-&gt;ID, $args);\n<\/code><\/pre>\n\n<p>Where $post-&gt;ID is the ID of the post for which you are wanting to show related articles.<\/p>\n\n<p>The $args parameter is an array with the following values available to you (more coming soon):<\/p>\n\n<ul>\n<li>posts_per_page (int defaults to 5)<\/li>\n<li>thumbnail_size (string consisting of one of these values: \"thumbnail\", \"medium\", \"large\", \"full\". Defaults to thumbnail).<\/li>\n<li>sort_prefer      (string consisting of one of these values: \"newest\", \"closest\". Defaults to newest).<\/li>\n<\/ul>\n\n<p>An example might be:<\/p>\n\n<pre><code>&lt;?php\n$args = array (\n    'posts_per_page' =&gt; 6,\n    'thumbnail_size' =&gt; 'medium',\n    'sort_prefer' =&gt; 'closest'\n);\n<\/code><\/pre>\n\n<p>The return value of pk_related_return is an array of objects that includes most of the fields within WordPress's posts\ntable plus permalink and featured image.<\/p>\n\n<p>Future Additions:<\/p>\n\n<p>Allow the user to specify only certain content types (posts, pages, custom) in a request. This would allow you to specify\nonly products get returned, or only blog posts. This would only be an issue if content types share taxonomies.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Upload <code>similar-posts-ontology<\/code> to the <code>\/wp-content\/plugins\/<\/code> directory<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress<\/li>\n<li>If you want the widget, go to 'Appearance' -&gt; 'Widgets' and look for Similar Posts Ontology widget. If you prefer to call programmatically, use the pk_related_return function in your theme.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id='how%20does%20this%20plugin%20work%3F'><h3>How does this plugin work?<\/h3><\/dt>\n<dd><p>There are two aspects to it. First, it finds all similarly tagged, categorized, and otherwise taxonomically created content\non your site, then sorts it by what has the most similarities. Second, if there is a tie between two posts it will give\nthe edge to the newest content, or content posted closer to the time your current post was posted, depending how you configure it.<\/p><\/dd>\n<dt id='why%20ontology%3F%20what%27s%20an%20ontology%3F'><h3>Why Ontology? What's an Ontology?<\/h3><\/dt>\n<dd><p>Ontology is the study of the nature of 'being'. This plugin uses the ontological philosophy of determining an entities \nplacement within its own 'type' by studying the entities relationships.<\/p><\/dd>\n<dt id='why%20am%20i%20not%20seeing%20any%20content%20when%20i%20install%20this%3F'><h3>Why am I not seeing any content when I install this?<\/h3><\/dt>\n<dd><p>You can use this in two ways. Either by calling pk_related_return() in your theme or by placing the widget on your site.\nIf you are using the widget, remember that it only works on any \"single\" page (where is_single() would return true). The\npk_related_return() can theoretically work anywhere as long as you provide a proper post ID. Try var_dump() with \npk_related_return() and look at the description for proper usage of this function.<\/p><\/dd>\n<dt id='why%20are%20my%20results%20coming%20back%20with%20weird%20content%20that%20i%20wouldn%27t%20expect%3F'><h3>Why are my results coming back with weird content that I wouldn't expect?<\/h3><\/dt>\n<dd><p>This issue may be your taxonomies. The content for which you're trying to find related content needs to have tags, \ncategories, and\/or custom taxonomies. Also, to properly find your content, tags\/categories\/taxonomies must be used on\nthe <em>related<\/em> content as well. The more you intentionally use your tags and categories, the better your results set will be.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>2.1<\/h4>\n\n<p><em>Release Date - July 31st, 2016<\/em>\n* Include some base styles to look better with common theme conventions\n* Fixed bug where author URL was broken\n* Tested up to 4.6<\/p>\n\n<h4>2.0<\/h4>\n\n<p><em>Release Date - August 15th, 2015<\/em>\n* Optimized query to allow for the option of specifying sorting preferences.<\/p>\n\n<h4>1.0.1<\/h4>\n\n<p><em>Release Date - January 11th, 2015<\/em>\n* Made the widget include HTML and classes that are best practice.<\/p>\n\n<h4>1.0<\/h4>\n\n<p><em>Release Date - January 10th, 2015<\/em>\n* First Version<\/p>","raw_excerpt":"Show a list of related posts that are similar to another post.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/33899","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=33899"}],"author":[{"embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/cfischer83"}],"wp:attachment":[{"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=33899"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=33899"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=33899"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=33899"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=33899"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/pcd.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=33899"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}