PHPackages                             erdiko/wordpress - 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. erdiko/wordpress

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

erdiko/wordpress
================

Erdiko Wordpress package

1.0.0(9y ago)71.8k7[2 issues](https://github.com/ArroyoLabs/erdiko-wordpress/issues)MITPHP

Since Sep 7Pushed 7y ago3 watchersCompare

[ Source](https://github.com/ArroyoLabs/erdiko-wordpress)[ Packagist](https://packagist.org/packages/erdiko/wordpress)[ Docs](http://erdiko.org)[ RSS](/packages/erdiko-wordpress/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (6)DependenciesVersions (14)Used By (0)

erdiko-wordpress
================

[](#erdiko-wordpress)

- Run your WordPress site headless
- Pull content from your wordpress CMS

You can use this module with any composer based php framework by simply running, composer require erdiko/wordpress.

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

[](#installation)

**1. Install WordPress**

We recommend installing WordPress in /lib/wordpress or its own folder at the same level as your main site. For instance /wordpress and /\[my-website\]. However it can be anywhere as long is the codebase is accessible. Follow the WordPress docs on how to install WordPress.

***Important*** If your WordPress codebase is in /lib/wordpress and /lib is at the same level as your vendor folder then you can skip the rest of step #1.

Add this to your codebase.

```
    define('WORDPRESS_ROOT', '/this/is/the/wordpress/path');

```

This could be added in a constants file, bootstrap file or index.php. Follow the conventions of your framework. If you are using Erdiko it should go in the /\[my-website\]/app/appstrap.php file.

**2. Add the erdiko/wordpress package using composer**

```
    composer require erdiko/wordpress

```

Usage
-----

[](#usage)

Here are some examples of how to use this package. See the source code for the full API.

To pull content from WordPress

```
$model = new \erdiko\wordpress\Model;
$post = $model->getPost(1);

```

To get an Author

```
$author = new \erdiko\wordpress\models\Author;
$author->getAuthor('name');

```

Get all posts

```
$content = new \erdiko\wordpress\models\Content;
$content->getAllPosts();

```

Create a full headless site with Erdiko
---------------------------------------

[](#create-a-full-headless-site-with-erdiko)

These additional instructions are for creating a complete headless blog using Erdiko. All CMS data is coming from WordPress and is rendered in a clean bootstrap based theme. We have included controllers, models, views and a full theme.

**1. Install Erdiko**Using composer, it is a very simple to create an erdiko project.

```
composer create erdiko/erdiko [my-project-name]

```

More information available at [http://erdiko.org](http://erdiko.org/)

**2. Add your routes**

Add the following lines to your routes.json file to enable the wordpress example and content controllers. It give you a FULL headless wordpress site. Use this as an example, extend the classes in your app or roll your own headless solution. Keep in mind, all that is really needed to pull WordPress data is to create a model that extends erdiko\\wordpress\\Model.

Update your /app/config/default/routes.json with:

```
"/": "\erdiko\wordpress\controllers\Posts",
"author/:alpha": "\erdiko\wordpress\controllers\Author",
"category/:alpha": "\erdiko\wordpress\controllers\Category",
"tag/:alpha": "\erdiko\wordpress\controllers\Tag",
"/:action": "\erdiko\wordpress\controllers\Content"

```

Feel free to adjust accordingly.

**3. Copy the default theme**

We even included a sample theme that is bootstrap based. Copy the files from your vendor folder vendor/erdiko/wordpress/app/themes/ and vendor/erdiko/wordpress/public/default/themes/ into your app/themes/ and public/default/themes folder respectively.

Theme is based on css from the [Start Bootstrap](https://startbootstrap.com/template-overviews/clean-blog/) theme.

**4. Add a symlink for the uploaded files (optional)**

```
	mkdir -p public/wp-content
	cd public/wp-content
	ln -s ../../../lib/wordpress/wp-content/uploads uploads

```

Notes
-----

[](#notes)

We welcome your feedback. Let us know how we can improve this package.

If anyone is interested in helping us port this to Laravel or Symfony please send us a message. We would love to support more frameworks!

Sponsored by [Arroyo Labs](http://arroyolabs.com/)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance14

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~102 days

Recently: every ~52 days

Total

10

Last Release

3352d ago

Major Versions

0.5.1 → 1.0.02017-03-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/691c8888935e19e59a2dd12e4e056e9b05991f4ebe696ef27fc01db8e9d1c984?d=identicon)[arroyolabs](/maintainers/arroyolabs)

---

Top Contributors

[![arroyo](https://avatars.githubusercontent.com/u/378457?v=4)](https://github.com/arroyo "arroyo (38 commits)")[![cmtk888](https://avatars.githubusercontent.com/u/5304840?v=4)](https://github.com/cmtk888 "cmtk888 (9 commits)")[![direction123](https://avatars.githubusercontent.com/u/8608251?v=4)](https://github.com/direction123 "direction123 (7 commits)")[![aavrug](https://avatars.githubusercontent.com/u/1022358?v=4)](https://github.com/aavrug "aavrug (1 commits)")[![ldaidone](https://avatars.githubusercontent.com/u/1054693?v=4)](https://github.com/ldaidone "ldaidone (1 commits)")[![saarmstrong](https://avatars.githubusercontent.com/u/142324?v=4)](https://github.com/saarmstrong "saarmstrong (1 commits)")

---

Tags

erdiko-wordpressheadlessphpwordpresserdikoerdiko packageerdiko-wordpress

### Embed Badge

![Health badge](/badges/erdiko-wordpress/health.svg)

```
[![Health](https://phpackages.com/badges/erdiko-wordpress/health.svg)](https://phpackages.com/packages/erdiko-wordpress)
```

###  Alternatives

[coldtrick/widget_manager

Manage your widgets

214.3k](/packages/coldtrick-widget-manager)[thalidzhokov/exchange-rates-cbrf

ExchangeRatesCBRF Class to get exchange rates of the Central Bank of Russia

102.7k](/packages/thalidzhokov-exchange-rates-cbrf)

PHPackages © 2026

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