WordPress allow you to create page and post in a default design, but if you like to design your homepage or other inner pages different from each other then you have to use custom page. In this article, I will show you how to create a custom page in WordPress.
First open your html editor, Notepad or Notepad++ or Sublime Text or anything which you have and create a blank page.
Now access the theme folder ( \wp-content\themes\themename\) and find page.php and open it in your editor, copy everything and paste it in your newly created blank page. Now you can see commented area which you have to remove and add following line to give template name.
<?php /* Template Name: My Custom Page */ ?>
Now the complete page will be with following code.
<?php /* Template Name: My Custom Page */ get_header(); ?> <div class="wrap"> <div id="primary" class="content-area"> <main id="main" class="site-main" role="main"> <?php while ( have_posts() ) : the_post(); get_template_part( 'template-parts/page/content', 'page' ); if ( comments_open() || get_comments_number() ) : comments_template(); endif; endwhile; ?> </main> </div> </div> <?php get_footer();
Save the file inside \wp-content\themes\themename\ folder. I have given the file name ‘custom.php’ and you can give the file and template name (Template Name: My Custom Page) as per your choice.
You are almost done and now access your admin section and create a new page from left panel and choose template name – ‘My Custom Page’ from right panel and add content in the editor area and publish it.
The WordPress custom page is ready and you can access the page from your website link. By using this custom page you can separate it from other pages design without affecting entire site design and format.