2

Twenty Twelve comes with some page templates: Front Page & Full Width. These are in the folder /page-templates.

I've created my own template and saved it into this folder, but it is not present to be selected when editing a page.

There is no mention of the two page templates in functions.php

What do I need to do to include my new page template?

  • Add the header (the first lines) of your template to the question. – fuxia Oct 10 '12 at 13:34
  • FYI, you should be doing all this in a child theme so you don't lose your changes. – mrwweb Oct 10 '12 at 14:01
2

Put the template file in your theme and add the following comment to the top of your file after the

/**
 * Template Name: This is the name of your template
 */

WordPress will pick this up and in the page templates dropdown you will see "This is the name of your template" listed as an option

1

According to http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

what you need to place at the top of the template file is

<?php
/*
Template Name: My Template File
*/
?>

and then the template will show up in the Template drop down in Page Attributes meta box and you'll be able to select it.

And, you should be working with a child theme, too, in order to not lose your changes and templates when twentyeleven is updated. See http://codex.wordpress.org/Child_Themes

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.