How to create a custom page template for WordPress Twenty thirteen theme

This article was written by in August 20, 2013, & may not be posted on other sites!
Original source url for this article: How to create a custom page template for WordPress Twenty thirteen theme

How to create a custom page template for WordPress Twenty thirteen theme?
It is easy! You should always work with a custom theme or a child theme when you start altering and adding custom code in WordPress. This is to avoid overwrite during WordPress updates and other conflicts with theme functions or plugins. You will need an ftp-connection and a simple text-editor. Just follow these steps to add a custom page template to Twenty Thirteen:

  1. Create your own child theme with the twenty thirteen theme as parrent theme.
  2. Inside your child theme folder, create a php-file named “my-template.php” or whatever you want to call it. The first code in this file should be:
    <?php
    /**
    * Template Name:  Your template name
    *
    * @package WordPress
    * @subpackage Twenty_Thirteen
    * @since Twenty Thirteen 1.0
    */
    ?>
  3. Put your custom php-code inside this file. You could copy and paste the code from page.php to get you started.
  4. Put this file directly inside your child theme folder, or in a folder inside your child theme folder called “page-templates”. Both will work. This is done with and ftp-client. If you don’t want to use a child theme, put the file directly in the Twenty thirteen theme folder.
  5. Log in to your WordPress site and create a new page.
  6. On the right inside under “page attributes” you should be able to choose your new template using the template dropdown.
  7. Update or Publish your new page and you are done!

 

Download the source code for a childtheme + one page template, ready to use:

This childtheme contains the basic files needed. (no styling added) It is using the Twenty Thirteen as parrent theme. Just download and upload + activate it on your WordPress site.

How to create a custom page template for WordPress Twenty thirteen theme

Page templates are made for specific pages or page-types:

How to create a custom page template for WordPress Twenty thirteen themeCreate a custom page template whenever you want a page to have a specific functionality or display content in a special way. Create as many custom page templates as you need, and use them on one or more pages in WordPress. You can also create custom page templates for other WordPress themes than Twenty thirteen.

Share this article

facebooktwittergoogle_pluslinkedinmail

3 thoughts on “How to create a custom page template for WordPress Twenty thirteen theme

  1. Matias

    Thank you so much for this. I want to create some custom squeeze pages for my blog. This is just what I needed.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">