WP Manifestindependent plugin directory
manifest / content / hm-related-posts

HM Related Posts

Related Posts (from HM Core) + Meta box for manually overriding dynamic selected posts.

by Human Made Limited · github.com/humanmade/hm-related-posts

12stars
4.2kcomposer installs
2forks

Install

No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:

wp plugin install https://github.com/humanmade/hm-related-posts/archive/refs/heads/master.zip

Also on Packagist as humanmade/related-posts:

composer require humanmade/related-posts

From the readme

Related Posts This plugin provides a simple related posts function with the following features: ElasticPress integration (uses a "More Like This" query) Admin UI for manually overriding related posts Installation Usage The plugin exposes a single function that returns a list of post IDs. HM\RelatedPosts\get( int $postid, array $args = [] ) $postid is the ID of the post to get related content for. $args allows you some control over the posts that are returned: - int limit: defaults to 10 - array posttypes: array of post types to limit results to. Defaults to [ 'post' ] - array taxonomies: array of taxonomies to compare against. Defaults to [ 'category' ] - array terms: array of WPTerm objects, results will match these terms - array termsnotin: array of WPTerm objects, results will not match these terms - bool epintegrate: if true then ElasticPress is used to get the results, Defaults to defined( 'EPVERSION' ) Custom post type support To add related posts support to your custom post type simply declare the following: addposttypesupport( 'your-custom-post-type', 'hm-related-posts' ); In addition to fine control the post types that have related posts support you can use

Read the full README on GitHub →

Releases

TagPublishedAssetDownloads
1.2.2Jan 22, 2019
1.2.1Nov 20, 2018
1.1.0Nov 20, 2018
1.0.1Jan 29, 2018
v1.0Mar 31, 2014