- Create a new file like page-my-template.php and save it under current theme root folder Or you can create copy of page.php file and save it with your page-home.php
- Now, Lets define custom template name under php commented line
<?php /** * Template Name: Home Page * * */ get_header(); ?> <!-- start content section --> <section class="page-content"> <?php if (have_posts()) while ( have_posts() ): the_post(); ?> <?php the_content(); ?> <?php edit_post_link( __( 'Edit', 'wpexperts' ), '', '' ); ?> <?php endwhile; ?> </section> <?php get_footer(); ?>
- Please note that you can use any name as your template name, There will not require that you use same name as php file
- Now press Ctrl+S to save the changes
- Your template is ready to use, On the right hand side under attributes you'll see template. This is where users are able to access your global page templates.
- That's it
How to create a custom template without using any plugin
You can create your own custom page template with any wordpress theme.
To create wordpress custom theme, please follow given steps