This lets you force a certain page to use a specified page template file.
This is useful if you want it to use some custom page template for a certain page, and for whatever your reason, you must assign it via a function file.
Replace $page_template
with your custom template file, relative to your theme’s template directory.
Example:
contact-page-template.php
or
page-templates/full-width.php
Replace $page_id with your page id (integer).
//use unique template update_post_meta(get_option( $page_id ), '_wp_page_template', $page_template);
Questions and Comments are Welcome