PHPackages                             devmium/blade-wp - 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. [Templating &amp; Views](/categories/templating)
4. /
5. devmium/blade-wp

ActiveLibrary[Templating &amp; Views](/categories/templating)

devmium/blade-wp
================

Blade package for WordPress

12PHP

Since Apr 30Pushed 7y agoCompare

[ Source](https://github.com/devmium/blade-wp)[ Packagist](https://packagist.org/packages/devmium/blade-wp)[ RSS](/packages/devmium-blade-wp/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependenciesVersions (1)Used By (0)

Blade templating engine for WordPress
=====================================

[](#blade-templating-engine-for-wordpress)

The simple yet powerful Blade templating engine ported to WordPress for themes developers.

Requirements
============

[](#requirements)

Before proceeding to installation, please make sure your environment met these requirements:

- [PHP](https://secure.php.net/manual/en/install.php) &gt;= 7.1+
- [Composer](https://getcomposer.org/download/)
- [WordPress](https://wordpress.org/) &gt;= 4.5+

Installation
============

[](#installation)

`composer require devmium/blade-wp`

Usage
=====

[](#usage)

```
use Devmium\Blade\WordPressBlade;

// Initialize WordPressBlade instance
$blade = WordPressBlade::getInstance();

// Render a specific template
WordPressBlade::render($view, $with = []);

// Register a custom directive
WordPressBlade::directive($name, $handler);
```

After initialing WordPressBlade service (usually in theme's functions.php file), it will automatically attempt to load template file first from **theme/views/{TEMPLATE\_FILE}.blade.php** then fallback to **theme/{TEMPLATE\_FILE}.php**

Examples
========

[](#examples)

Giving the following directory structure:

```
theme
- assets/
- includes/
- views/
    - single.blade.php
    - archive.blade.php
    - index.blade.php
- index.php
- style.css

```

Assuming a single post request (is\_single() === true), the service will load **theme/views/single.blade.php**. If **theme/views/single.blade.php** doesn't exist, the service will fallback to **theme/single.php** and then **theme/index.php**

Built-in WordPress custom directives
====================================

[](#built-in-wordpress-custom-directives)

Simple loop:
------------

[](#simple-loop)

```
@wp_posts()
    {{ the_title() }}
    {!! the_content() !!}
@wp_empty()
    {{ 'No posts' }}
@wp_end()
```

Notes
=====

[](#notes)

TBD

Blade documentation
===================

[](#blade-documentation)

You can browse [Blade's documentation](https://laravel.com/docs/5.7/blade) directly from Laravel documentation.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/edc04a8d511a0551b3c981c46f4d20b60c4c8cdaa383f812345073d22244e036?d=identicon)[devmium](/maintainers/devmium)

---

Top Contributors

[![devmium](https://avatars.githubusercontent.com/u/33166640?v=4)](https://github.com/devmium "devmium (2 commits)")

---

Tags

bladewordpresswordpress-themewordpress-theme-development

### Embed Badge

![Health badge](/badges/devmium-blade-wp/health.svg)

```
[![Health](https://phpackages.com/badges/devmium-blade-wp/health.svg)](https://phpackages.com/packages/devmium-blade-wp)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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