PHPackages                             ixa/layout - 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. ixa/layout

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

ixa/layout
==========

WordPress library that provides basic support to use layouts in themes

0.3.1(11y ago)4651MITPHPPHP &gt;=5.3

Since Jan 24Pushed 11y ago1 watchersCompare

[ Source](https://github.com/cesarhdz/ixa-layout)[ Packagist](https://packagist.org/packages/ixa/layout)[ RSS](/packages/ixa-layout/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (8)Used By (0)

Ixa Layout
==========

[](#ixa-layout)

[![Build Status](https://camo.githubusercontent.com/c3e9c9d8d57ff34ea25b898f50c108335628be9a9eecc7dd7caf73ea2f93d61c/68747470733a2f2f7472617669732d63692e6f72672f636573617268647a2f6978612d6c61796f75742e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/cesarhdz/ixa-layout)

Ixa Layout is a WordPress library that provides basic support to use layouts in themes.

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

[](#requirements)

Besides PHP 5.3 you need a WordPress installation with [Composer](http://getcomposer.org), for example, [Ixa Wordpress Starter](http://github.com/cesarhdz/ixa-wordpress-starter).

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

[](#installation)

Require as dependency in `composer.json`

```
"require": {
    ...
    "ixa/layout" : "0.3"
}

```

And register the filter in `/functions.php` file:

```
Ixa\Layout\LayoutFilter::register();

```

After registering the filter you can decorate your [views](#views) with [layouts](#layouts). By default layout folder is `/layouts`, it can be changed using the first parameter: `LayoutFilter::register($customDir)`.

Views
-----

[](#views)

In the layout pattern, a view is the template that holds the main content. In WordPress terms are the files loaded following template hierarchy.

Regular views have a structure similar to

```

```

Using IxaLayout we can get rid of all unrelated templates tag, writing only the main content:

```

```

IxaLayout will parse the content and display when the layout call `yield_content()` function.

### Layouts

[](#layouts)

Layouts are wrappers for views, they use the same syntax and functions that regular WordPress templates. They also have the covenient function `yield_content()` which loads the parsed content of the view.

A tipical layout would be:

```

```

### Layout Selection

[](#layout-selection)

All layouts must be placed under /layouts folder. default.php layout is requiered since is the fallback in case selected layout is not found.

Within a view we can set the layout we want to apply using `layout()` function. The first parameter is the relative path, without extension of the layout:

```
layout('services')

```

Ixa Layout Will try to load `/layouts/services.php` file, if it doesn't exists will fallback to `/layouts/default.php`. In case no layout is found an `Ixa/Layout/LayoutNotFoundException` wil be thrown.

How *Ixa Layout* works
----------------------

[](#how-ixa-layout-works)

Ixa Layout is a filter attached to `template_include` with a priority of `10000` in order to be run after all filters, then loads and saves the view selected by WordPress following template hierarchy and returns the path to the layout that WordPress loads.

Ixa Layout isn't a plugin that's why it requires to be autoloaded by Composer and registered in your `functions.php` file. This way we can have consistent code across environments because we don't have to wait the user to activate the plugin.

Development status
------------------

[](#development-status)

It's not fully tested and may collapse with plugins or themes that use `template_include` filter or `ob_get_contents()` function.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~34 days

Recently: every ~28 days

Total

6

Last Release

4320d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1fa78b7283388ae1de39abc6410b2b9c5e4c1645acdee9fff705c2064f64c099?d=identicon)[cesarhdz](/maintainers/cesarhdz)

---

Top Contributors

[![cesarhdz](https://avatars.githubusercontent.com/u/855280?v=4)](https://github.com/cesarhdz "cesarhdz (41 commits)")

---

Tags

wordpresslayoutwordpress plugin

### Embed Badge

![Health badge](/badges/ixa-layout/health.svg)

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

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[teepluss/theme

Theme will help you organize your themes inside Laravel projects easily and maintain its related assets, layouts and partials for the theme in single directory.

543174.1k8](/packages/teepluss-theme)[gamajo/template-loader

A class for your WordPress plugin, to allow loading template parts with fallback through the child theme &gt; parent theme &gt; plugin

29647.0k5](/packages/gamajo-template-loader)[hexbit/sage-woocommerce

Woocommerce support for sage 10

257.0k](/packages/hexbit-sage-woocommerce)

PHPackages © 2026

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