get_template_part function in wordpress code example
Example 1: get template part wordpress
<?php get_template_part( 'partials/content', 'page' ); ?>
Example 2: get template part wordpress
// You wish to make $my_var available to the template part at `content-part.php`
set_query_var( 'my_var', $my_var );
get_template_part( 'content', 'part' );