Skip to content

Instantly share code, notes, and snippets.

@Xilonz
Xilonz / setup.php
Created February 27, 2018 10:50
Sage Wordpress Query Loop for Blade templates
/**
* Add this to your setup.php
* Usage @loop( $wp_query ) or $loop and end with @endloop
* the new $loop variable is available
*/
/**
* Create @loop Blade directive
*/
sage('blade')->compiler()->directive('loop', function ( $query = null ) {