I’d like to create a new template (like “no-sidebar.php”). I already created the PHP file.
Where do I have to register it so it will show up in my template options when creating or editing a page?
For creating the new template file you need to add template name
In No Sidebar template file at the very top you will find
/*
Template Name: No Sidebar
*/
If you want to create new template file just copy the no-sidebar.php file, rename it and change the ‘Template Name’ then it will display in template options.
Simply open any text editor and paste the following code in it.
<?php /* Template Name: PageWithoutSidebar */ ?>
The above line of code tells WordPress that it is a template file called PageWithoutSidebar. You can use any name you want. Now save this file as PageWithoutSidebar.php. Again you can use any other name for the file. But don’t forget to keep the extension as .php