How to create your own page template in WordPress?

Creating your own page template in WordPress requires some knowledge of the programming languages ​​HTML, CSS and PHP. We will explain how to create your own version of an existing page template. The same goes for creating a page template from scratch.

  1. Make a copy of the page template you want to use as a base in the folder /wp-content/themes/themex (themex is then the theme you currently use in WordPress).
  2. At the top of the new PHP document, edit this piece of code with the name of your template:
    <?php
    /*
    Template Name: name of your new template
    */
    ?>
  3. Make the necessary adjustments to the page template. (Suppose you start from a page template with sidebar and you want to get rid of it, you can do that by removing this piece of code:
    <?php get_sidebar(); ?>)
  4. Save your template

From then on, your page template will appear among the other page templates in the selection box on the right.

You can of course seek further help with your page templates from a WordPress specialist.

Need help
with a topic?

Or looking for
something else?

Drop us a note

This field is for validation purposes and should be left unchanged.
WPorters