Introduces how to create custom page templates in a WordPress site and restrict the displayed PHP using the WordPress API in PHP programming language.
The custom page feature makes it easy to display only the header, or display only the header and footer.
- Save a PHP file with a meta comment at the beginning like the following in the theme directory or child theme directory
This PHP will be the displayed PHP. Feel free to modify it.
<ol>
<li>Create a new page and freely edit the content</li>
</ol>
There is a "Template" setting in the right sidebar, so change it to the name in the meta comment (demo).
<ol>
<li>Publish and preview, if there are no problems, OK</li>
</ol>
The file <code>[theme]/page.php</code> is the original page PHP file, so it might be good to copy this and debug while editing.
Reference:
[How to Create a Custom Page in WordPress](https://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/)