<!-- file shouldn't be named wp-lunch.php as it's not part of WP core -->
<?php if ( current_user_can( 'eat_sandwich' ) ): // more specific verb makes more sense to me ?>
<?php get_header( 'sandwich' ); // native function accepts type argument ?>
<?php while ( have_fillings() ): the_filling(); // maybe native API, but feels acceptable wrapper for semantics ?>
<?php get_template_part( 'filling', get_filling_type() ); // native API, what would be `thick_layer` base? ?>
<?php endwhile; wp_reset_postdata(); // reset $post global ?>
<?php get_footer( 'sandwich' ); // native function accepts type argument ?>
<?php endif; ?>
Spacing adjusted for coding style, etc.
Sandwich template with bit of Twig, eaten on MeadowMeadow will look something like:
{% if ( current_user_can( 'eat_sandwich' ) ) %}
{% include 'header-sandwich.twig' %}
{% loop fillings %}
{% include 'filling-' ~ get_filling_type() ~ '.twig' ignore missing %}
{% endloop %}
{% include 'footer-sandwich.twig' %}
{% endif %}