diff --git a/src/setup.php b/src/setup.php index b60ab26..0d4227d 100644 --- a/src/setup.php +++ b/src/setup.php @@ -89,6 +89,14 @@ add_action('widgets_init', function () { ] + $config); }); +/** + * Updates the `$post` variable on each iteration of the loop. + * Note: updated value is only available for subsequently loaded views, such as partials + */ +add_action('the_post', function ($post) { + sage('blade')->share('post', $post); +}); + /** * Setup Sage options */