PHPackages                             johnpbloch/loopable-query - 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. [Database &amp; ORM](/categories/database)
4. /
5. johnpbloch/loopable-query

ActiveLibrary[Database &amp; ORM](/categories/database)

johnpbloch/loopable-query
=========================

A loopable object for all your WP\_Query needs

0.1.0(13y ago)3314GPL-2.0+

Since Jun 26Pushed 13y ago1 watchersCompare

[ Source](https://github.com/johnpbloch/loopable-query)[ Packagist](https://packagist.org/packages/johnpbloch/loopable-query)[ RSS](/packages/johnpbloch-loopable-query/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (2)Used By (0)

Loopable Query
==============

[](#loopable-query)

Loopable Query lets you loop through `WP_Query` objects in a `foreach` loop.

```
$featured_posts = new Loopable_Query( new WP_Query( array(
	'category_name' => 'featured',
	'posts_per_page' => 5,
) ) );

foreach( $featured_posts as $feature ) {
	echo '';
	the_title();
	echo '';
}
```

If you don't pass in a custom query object, it will use the global `$wp_query` object, letting you use this for the main query object.

### Ok, so... why?

[](#ok-so-why)

Why not? Sometimes you want a simpler way to handle looping through posts.

### Installing

[](#installing)

Use [Composer](http://getcomposer.org) to add Loopable Query to your project.

```
{
	"require": {
		"johnpbloch/loopable-query": "~0.1"
	}
}

```

### Contributing

[](#contributing)

Pull requests are welcome. Loopable Query has unit tests. To run them, clone the repository, [install composer](http://getcomposer.org/doc/00-intro.md), and run the following commands:

```
composer install --dev
vendor/bin/phpunit

```

### License

[](#license)

Loopable Query is licensed under the GPL version 2 or later.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

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

Unknown

Total

1

Last Release

4753d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/044e10bd302ddb296511f2a463f61314bc17338c34fc0d292d05a425c655bc34?d=identicon)[johnpbloch](/maintainers/johnpbloch)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/johnpbloch-loopable-query/health.svg)

```
[![Health](https://phpackages.com/badges/johnpbloch-loopable-query/health.svg)](https://phpackages.com/packages/johnpbloch-loopable-query)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M114](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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