Step One: Create Custom Page Template in your root WordPress theme folder
Instead of adding an additional new custom template file in your WordPress template folder, you can create a new folder with a specific name to serve any custom WordPress Page Templates to assign them to specific Pages in your WordPress website.
I Got a new Land Page in the WordPress Page Templates Folder Like the example below:
To get the new custom page template layout available to assign it to your specific page on the website you need to hook the function for this.
Step Two: At the top of your custom page template file add the related function from WordPress Codex
<?php /* Template Name: Landing AMP Projects */;?>
To learn more about how it’s work visit Creating Custom Page Templates for Global Use
Step Three: Create New Folder in your WordPress root Template Folder to serve the new files for get_header() and get_footer() functions
In my example, I create a new folder in my current active WordPress Template folder with the name “lamp“. In the new folder create your custom get_header() and get_footer() files to load on your custom page template. The customized head and footer files are served as template parts and are not necessary to name them with
This is because we will get them with the WordPress function get_template_part() and will not serve this 2 new header and footer required WordPress Template files from the root how it is by the default function for WordPress Templates to include Template Tags – Include_Tags
Step Four: Create two new files in the “lamp” folder as the example below
Step Five: Open your Custom Page Template from Step One and below the 1st-row code the snippets below
- <?php get_template_part( ‘lamp/header-amp’ );?>
- <?php get_template_part( ‘lamp/footer-amp’ );?>
Recommended Article about the next part of loading the content on those new pages with running the basic Loop and display your WordPress Page Content
What the_content and get_the_content are used in WordPress?
What the_permalink and get_the_permalink functions are used for in WordPress?
How to create a simple WordPress Loop for posts?
05/03/2021 by SEO Book Pro