You don’t reuse a specific page’s data via get_template_part
, you query for a specific page’s data and use get_template_part
to output the result. Look at how any of the core-bundled themes use get_template_part
within the loop to output the main query for an example.
Query for the page:
$query = new WP_Query( array(
'post_type' => 'menu',
'name' => 'monday'
) );
if( $query->have_posts() ){
$query->the_post();
get_template_part( 'menus' );
wp_reset_postdata();
}
Then menus.php
outputs the result:
<?php
the_title();
the_content();
// etc..