Forums

New custom page template (page2.php) won't appear (6 posts)

  1. DLMST
    Member
    Posted 2 years ago #

    Hi, I'm trying to add a second page template (named page2.php) to the theme so that I can use the default page template for most pages and the new page template for a different page. The only difference is that the new page template does NOT include the sidebars. I uploaded the new page template to the theme folder but it does not appear in the pulldown template list when I want to add a new page. I tried your suggested theme reactivation step but that did not result in the new page template appearing either. Any ideas on what I should try next?

    Thank you in advance for any help,
    DLMST

  2. Peter Boosten
    Member
    Posted 2 years ago #

    You probably know that page templates should start with this piece of code, right?

    < ?php
    /*
    Template Name: Your Custom Page Template
    */
    ?>

    Peter

  3. DLMST
    Member
    Posted 2 years ago #

    (blushing) Ooooops ... nooooooooooooo ... (I merely copied the original page template and took out the code that called up the sidebars).

  4. DLMST
    Member
    Posted 2 years ago #

    Do I write it like this?

    < ?php
    /*
    Template Name: page2.php
    */
    ?>

  5. DLMST
    Member
    Posted 2 years ago #

    I added the code .... Thank you!!

  6. stjones911
    Member
    Posted 2 years ago #

    Same problem (WP 2.9 on localhost with .htaccess file). This code was copied out of pages-page.php in the Theme Editor, so the file is definitely visible:

    <?php
    /*
    Template: pages-page
    */
    ?>

    I also tried "pages-page.php" as the "Template:" entry.

    Maybe I'm not finding the list to select it from; I've only found a list (labeled "Template") when I Quick Edit the Page I'd like to use the template. The only entry in that list is "Default Template". Thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Topic