*/ class WordpressTemplatingServiceProvider extends ServiceProvider { /** * Perform post-registration booting of services. * * @return void */ public function boot() { Blade::directive('loop', function () { return 'hasPosts()): while (query()->hasPosts()): ' . 'query()->post(); $post = post(); ?>'; }); Blade::directive('endloop', function () { return ''; }); Blade::directive('wphead', function () { return ''; }); Blade::directive('wpfooter', function () { return ''; }); if (function_exists('gravity_form')) { Blade::directive('gravityform', function ($expression) { return ""; }); } View::addNamespace('theme', base_path() . '/resources/views/themes/' . wp_get_theme()->stylesheet); } }