Support » Fixing WordPress » Custom page template in Edit Page dropdown list

  • Based on the below post I just read:

    It sounds like this may be something I can do to get my custom page template to show up on the Edit page Admin screen (in the dropdown list)

    My situation is that I created the custom page template, put it in my theme folder, it comes up in the Widgets section for adding sidebars for that specific page template, BUT it is not listed in the dropdown list when I edit a page (the dropdown shows up and has other page templates, just not the new one I just created)

    Based on the above post, I am thinking I can just ftp my customer page template to the other theme folders. Because of the extent of pages, and changes I have done to this site so far, I don’t want to change the theme incase that would cause more problems.

    Will just FTP’ing my custom page template to the other theme folders be enough given my situation briefly explained above?

    Thanks! ~Derek

Viewing 15 replies - 1 through 15 (of 15 total)
  • It’s sort of hard to figure out what you trying to do.

    Are you using a custom post type? If so, the page template for the custom post type should be either single-{post_type}.php or archive-{post_type}.php where you replace {post_type} with the name of your post type. These would not show in the drop down because WordPress uses them automatically when viewing that content type. See this for more info on that:

    If you are just trying to create a new page layout, you added the template name in the php at the top of your file?? Like:

     * Template Name: Insert_your_template_name_here
    */ ?>

    If you want, and are comfortable with posting your code online, you can use and paste the code of your template file in there so I (or others) would be able to see if we can figure out what’s going on.

    Hope that helps,

    @andy – Thanks for the reply. I am not trying to use a custom post type – I don’t think! 😉

    What I am trying to do is display certain sidebar menus based on the page group is viewed, so to do that I tried tocreate a new page template – that has right sidebar – and then I could be able to setup what sidebar widgets to use for the specific page template.

    The New page template I created shows up in the Admin>>Widgets section as a page template, but not on the Admin>>Edit Page screen as one of the dropdown options.

    If it helps at all I’m using the Swift Theme…

    Also… I do have that Template Name at the top of the file…
    I actually used an existing page template file, that had right sidebars, and saved as different file name and changed the Template Name section at the top. Thanks again!

    Just to make sure, you have reloaded the page?

    what’s the name of your file?

    @andy – Thanks. Yes I did reload the page, and logout and login also…

    the page template name is page-temp-studylearn.php (exact name convention as the other ones which is page-temp-[name].php)

    and the file path is:

    unfortunately I am at ‘work’ now, so I cannot post the code from the file itself at this time…

    Thanks again

    I would suggest trying to name the file studylearn.php and see if that at least gets it to show up.

    Another option would be to create a new file, name it something completely unique and just for testing purposes, maybe templatetest.php, add the template name to the file:

    /* Template Name: Example Template */

    Then don’t put anything else in the file, and see if that works. Then you would know that WordPress is working correctly, and there must be an issue in your code.

    what version of WordPress are you running?

    WordPress version is 3.4. I will try to rename the file to just studylearn.php and let you know.

    I added this template name to the sidebar-init.php file to initialize it – I’m guessing for the admin>>widgets section. Is there perhaps another WP config file I need to add this to for the template page dropdown of the edit page also?

    Ok… quick update!

    The template name I put in the top of the file was the same name as the other page template (so I never changed the top name)

    I changed the name in the file, re-uploaded it via ftp and tried to goto edit page and it is listed now…

    @andy – Thanks for all your help!

    Cool, great.

    I am having the same problem reported here and in other forum posts. However, none of these solutions work for me. I have tried logging in/out, switching themes, re-uploading files, double-checked php files, template names. Using the Roots Theme .

    Any further suggestions?

    @edanweis – Have you tried creating another file, name it something like templateexampletest.php, add the template name php comment:

    /* Template Name: Template Example Test */

    Then FTP that to your server and see if that one works.

    If you do that and it that doesn’t show up, then it’s probably beyond me. If that template (which does nothing) shows up in the list, then you would know there is an issue with either the name of the file, or something in the file.

    It’s really hard to guess at these things without being able to look at the files and troubleshoot them.

    It works now, I thought I tried that before.. my apologies… thank you!!

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Custom page template in Edit Page dropdown list’ is closed to new replies.