Skip to content

Latest commit

 

History

History
28 lines (19 loc) · 528 Bytes

README.md

File metadata and controls

28 lines (19 loc) · 528 Bytes

loopy

For the loopy developers who want to iterate with foreach over WP_Query.

usage

main query

foreach( loopy($GLOBALS['wp_query']) as $post ) {
    // ...
}

secondary query

$myQuery = new WP_Query('category_name=example-category');

foreach( loopy($myQuery) as $post ) {
    // ...
}

further information