PHPackages                             ernilambar/wp-related-posts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. ernilambar/wp-related-posts

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

ernilambar/wp-related-posts
===========================

WordPress related posts

2.0.0(3y ago)0159MITPHPPHP &gt;=5.6

Since May 12Pushed 2y ago1 watchersCompare

[ Source](https://github.com/ernilambar/wp-related-posts)[ Packagist](https://packagist.org/packages/ernilambar/wp-related-posts)[ Docs](https://github.com/ernilambar/wp-related-posts)[ RSS](/packages/ernilambar-wp-related-posts/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

WP Related Posts
================

[](#wp-related-posts)

WordPress related posts helper class to fetch related posts based on post's taxonomies.

Requirements
------------

[](#requirements)

- WordPress 5.1+.
- PHP 5.6+.
- [Composer](https://getcomposer.org/) for managing PHP dependencies.

Installation
------------

[](#installation)

First, you'll need to open your command line tool and change directories to your theme folder.

```
cd path/to/wp-content/themes/
```

Then, use Composer to install the package.

```
composer require ernilambar/wp-related-posts
```

Assuming you're not already including the Composer autoload file for your theme and are shipping this as part of your theme package, you'll want something like the following bit of code in your theme's `functions.php` to autoload this package (and any others).

The Composer autoload file will automatically load up the package for you and make its code available for you to use.

```
if ( file_exists( get_parent_theme_file_path( 'vendor/autoload.php' ) ) ) {
  require_once get_parent_theme_file_path( 'vendor/autoload.php' );
}
```

Usage
-----

[](#usage)

You can fetch related post using `posts` method.

```
use Nilambar\WPRelatedPosts\RelatedPosts;

$args = array(
  'number'     => 3,
  'taxonomies' => array( 'post_tag' ),
);

$related_posts = RelatedPosts::posts( get_the_ID(), $args );
```

Copyright and License
---------------------

[](#copyright-and-license)

This project is licensed under the [MIT](http://opensource.org/licenses/MIT).

2022 © [Nilambar Sharma](https://www.nilambar.net).

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~152 days

Total

2

Last Release

1405d ago

Major Versions

1.0.0 → 2.0.02022-10-11

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2098823?v=4)[Nilambar Sharma](/maintainers/ernilambar)[@ernilambar](https://github.com/ernilambar)

---

Top Contributors

[![ernilambar](https://avatars.githubusercontent.com/u/2098823?v=4)](https://github.com/ernilambar "ernilambar (7 commits)")

---

Tags

wordpressrelated posts

### Embed Badge

![Health badge](/badges/ernilambar-wp-related-posts/health.svg)

```
[![Health](https://phpackages.com/badges/ernilambar-wp-related-posts/health.svg)](https://phpackages.com/packages/ernilambar-wp-related-posts)
```

###  Alternatives

[aristath/kirki

Extending the WordPress customizer

1.3k73.1k4](/packages/aristath-kirki)[afragen/git-updater

A plugin to automatically update GitHub, Bitbucket, GitLab, or Gitea hosted plugins, themes, and language packs.

3.3k1.8k](/packages/afragen-git-updater)[tacowordpress/tacowordpress

WordPress custom post types that feel like CRUD models

232.2k](/packages/tacowordpress-tacowordpress)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
