2017 © Pedro Peláez
 

library loopable-query

A loopable object for all your WP_Query needs

image

johnpbloch/loopable-query

A loopable object for all your WP_Query needs

  • Wednesday, June 26, 2013
  • by johnpbloch
  • Repository
  • 1 Watchers
  • 3 Stars
  • 20 Installations
  • 0 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Loopable Query

Loopable Query lets you loop through WP_Query objects in a foreach loop., (*1)

$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 ', (*2)

'; }

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., (*3)

Ok, so... why?

Why not? Sometimes you want a simpler way to handle looping through posts., (*4)

Installing

Use Composer to add Loopable Query to your project., (*5)

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

Contributing

Pull requests are welcome. Loopable Query has unit tests. To run them, clone the repository, install composer, and run the following commands:, (*6)

composer install --dev
vendor/bin/phpunit

License

Loopable Query is licensed under the GPL version 2 or later., (*7)

The Versions

26/06 2013

dev-master

9999999-dev

A loopable object for all your WP_Query needs

  Sources   Download

GPL-2.0+

The Development Requires

by John P. Bloch

26/06 2013

0.1.0

0.1.0.0

A loopable object for all your WP_Query needs

  Sources   Download

GPL-2.0+

The Development Requires

by John P. Bloch