Skip to content

Instantly share code, notes, and snippets.

@gschoppe
Created August 21, 2018 22:54
Show Gist options
  • Save gschoppe/044a2f6aa2481f408357b28b20361a7f to your computer and use it in GitHub Desktop.
Save gschoppe/044a2f6aa2481f408357b28b20361a7f to your computer and use it in GitHub Desktop.
Add Featured Image Tag to Timber
<?php
/* populates the twig tag {{ featured_image_tag }} */
add_filter('timber_context', function( $context ){
$context['featured_image_tag'] = get_the_post_thumbnail( null, 'full' );
return $context;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment