{"id":29150224,"url":"https://github.com/humanmade/hm-related-posts","last_synced_at":"2025-06-30T23:09:55.717Z","repository":{"id":10628525,"uuid":"12851681","full_name":"humanmade/HM-Related-Posts","owner":"humanmade","description":"Related Posts (from HM Core) + Meta box for manually overriding dynamic selected posts.","archived":false,"fork":false,"pushed_at":"2019-01-22T18:17:58.000Z","size":121,"stargazers_count":12,"open_issues_count":5,"forks_count":2,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-06-30T16:14:52.620Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/humanmade.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-15T20:01:33.000Z","updated_at":"2019-01-22T18:17:28.000Z","dependencies_parsed_at":"2022-09-22T20:24:01.675Z","dependency_job_id":null,"html_url":"https://github.com/humanmade/HM-Related-Posts","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/humanmade/HM-Related-Posts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FHM-Related-Posts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FHM-Related-Posts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FHM-Related-Posts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FHM-Related-Posts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/humanmade","download_url":"https://codeload.github.com/humanmade/HM-Related-Posts/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/humanmade%2FHM-Related-Posts/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262864257,"owners_count":23376461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-30T23:09:54.529Z","updated_at":"2025-06-30T23:09:55.704Z","avatar_url":"https://github.com/humanmade.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Related Posts\n=============\n\nThis plugin provides a simple related posts function with the following features:\n\n* ElasticPress integration (uses a \"More Like This\" query)\n* Admin UI for manually overriding related posts\n\n## Installation\n\n```\ncomposer require humanmade/related-posts\n```\n\n## Usage\n\nThe plugin exposes a single function that returns a list of post IDs.\n\n### `HM\\Related_Posts\\get( int $post_id, array $args = [] )`\n\n**$post_id** is the ID of the post to get related content for.\n\n**$args** allows you some control over the posts that are returned:\n\n- int **limit**: defaults to `10`\n- array **post_types**: array of post types to limit results to. Defaults to `[ 'post' ]`\n- array **taxonomies**: array of taxonomies to compare against. Defaults to `[ 'category' ]`\n- array **terms**: array of `WP_Term` objects, results will match these terms\n- array **terms_not_in**: array of `WP_Term` objects, results will not match these terms\n- bool **ep_integrate**: if true then ElasticPress is used to get the results, Defaults to `defined( 'EP_VERSION' )`\n\n### Custom post type support\n\nTo add related posts support to your custom post type simply declare the following:\n\n`add_post_type_support( 'your-custom-post-type', 'hm-related-posts' );`\n\nIn addition to fine control the post types that have related posts support you can use the `hm_rp_post_types` filter.\n\n```php\nadd_filter( 'hm_rp_post_types', function ( $post_types ) {\n    // your code goes in here\n\n    return $post_types;\n} );\n```\n\n---------------------\n\nMade with ❤️ by [Human Made](https://humanmade.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fhm-related-posts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhumanmade%2Fhm-related-posts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhumanmade%2Fhm-related-posts/lists"}