Page Template drop down missing in WordPress 2.6

Aug 10, 2008 | Featured, Wordpress


I upgraded from 2.5.1 to 2.6 last month. It is a good version and better than previous one. They fixed the Custom field problem and I am happy.

I discovered some new bugs in this version. Where are page template drop down in WordPress 2.6? Ya, the page template section is missing. I couldn’t find it whenever i try to create new page with custom template. Weird @-@

So, i just play with the wp-admin dir and try search the problem. What make this thing happen?
I figured out the edit-page-form.php in 2.6 is not the same as the 2.5. They add some new function to it.

The new 2.6 :

2.5

*click for bigger image

<?php if ( 0 != count( get_page_templates() ) ) {  ?>

If it not equal to zero(the number of page template in you theme dir), it will automatically appear. But the page template drop-down still not there . What i can see is they add function. It is totally different.

Solution :
I made some modification to edit-page-form.php by adding some value.

  1. Go to wp-admin dir. search for edit-page-form.php
  2. Open it with text editor.
  3. Go to line 265. replace 0 with greater value like 110.
  4. Save it.

Refresh post page. The Page Template drop down should automatically appear now.

Bookmark and share this post:

About this post:

Posted by: Ajmal

Date: Aug 10, 2008

Tags:

33 Responses

Add your comment

  1. August 10th, 2008

    not having problem with it.. if the template file is available on theme directory n correctly specify it for custom template it will automatically appear.. if the file doesnt exist the menu will not be there..

  2. August 23rd, 2008

    It worked for me, thx.

  3. qq
    August 26th, 2008

    this kinda out of topic question,
    what kind of software are u using to edit the php file?

  4. August 26th, 2008

    i use e-text editor

  5. August 30th, 2008

    Hi,

    I found this and another weird solution about changing the theme, any of then worked for me.

    I just changed wp-admin.css

    I posted here:

    http://ceslava.com/blog/solucin-al-bug-de-wp-26-para-las-plantillas-de-pginas/

    The post in spanish but you just have to look for the last css code

  6. September 16th, 2008

    Thanks for that – got the menu on but the drop down didn’t contain any of the theme templates! Ahhhh!

  7. September 18th, 2008

    WP 6 it’s ok. Just you must add template (admin panel) when you add new file with template.

  8. Joakim
    September 21st, 2008

    The drop down appears but it is not possible to select a page template. Am I supposed to change this:
    [code]

    [/code]

    in some way?

  9. Joakim
    September 21st, 2008

    This is hidden in my latest post:
    /*
    Template Name: Links
    */

  10. September 21st, 2008

    @joakim

    better don’t. i suggest you to upgrade to the latest 2.6.2. I guest there is something wrong with the theme code that disable some wp-dashboard function. Some themes are fine. If the template already in the directory. The drop down menu will show. Else check your theme function.php

    i hope my explaination will help you

  11. October 1st, 2008

    I am using wordpress MU and the admin main site has the page template, but the smaller sites ( mysite.com/othersite ) doesn’t have the template.

  12. October 4th, 2008

    i am not sure about wp MU. sorry

  13. October 7th, 2008

    Подскажите шооблончег под Wordpress 2.6.2, чтобы был похож на ваш frozr.com.

    Заранее благодарю)

  14. div
    October 9th, 2008

    Hi,

    Thanks for this. I was wondering where this function has gone :)

  15. 7hunters
    October 29th, 2008

    Thank you so much!! I installed word press with Fantastico and noticed that the templates were no longer there – since my site uses about ten templates I was in real trouble! Thanks again for the fix!! :-)

  16. November 30th, 2008

    This worked for me too, and was the only fix I found that did. I only had a problem with this using certain themes. Good job and thanks for posting it!

  17. elorg
    March 30th, 2009

    I think this may be a work-around that doesn’t necessarily fix an underlying problem.

    I have 2 new installs of the latest version (development & production). Both have the same configuration. Both have “0″ in the edit-page-form.php file. Meanwhile, the template dropdown is available for one of the installs and not the other.

  18. elorg
    March 30th, 2009

    Actually, update:
    All I had to do was temporarily activate a different template, then reactivate my real template and the dropdown appears and functions properly. Hope that helps.

  19. May 28th, 2009

    In the actual template php file (for example: archives.php), you have to include the blurb at the top of the file that says:

    Check out the first 10 lines of the default template’s archive.php.

    That solved the problem for me. Until wordpress recognizes there is more than 1 main template they won’t put the drop down box for Page Templates.

    Hope that helps!

  20. May 28th, 2009

    ok it took out the code from my first post below, sorry. Just check out the first few lines of the Default themes’ archives.php file.

  21. October 6th, 2009

    YOUR A GENIUS! WORKED PERFECTLY!! THANKS!!!

  22. October 21st, 2009

    It worked! But I can only select the default template…

  23. rebekka
    October 24th, 2009

    thanks, it worked… just what i was looking for!

  24. rebekka
    October 24th, 2009

    Rejoyed too soon!

    the drop-down-menu is now showing – but only the default theme. no more choices. ???
    am using stocks starkers theme in wp 2.8.4… and can´t find a solution it seems…

  25. rebekka
    October 24th, 2009

    oh, i found the problem…
    i didn´t name my theme in the css-file and so wp had some difficulties… it´s working now….

  26. November 26th, 2009

    Wow… I am looking for this since long… finally you made my day! :)

  27. Ryan P
    December 11th, 2009

    I never imagined I would find a fix for this issue, thanks so much!!!!!!!!!!!!

  28. February 11th, 2010

    Selecting a theme again from admin did the trick for me.

  29. May 12th, 2010

    The problem is not the code, but rather the fact that the template files must have the appropriate comment at the top to denote them as a template file. If, for example, the archive.php file does NOT have the comment as follows:
    /*
    Template Name: Archives
    */
    near the top, it will not be recognized by the drop-downs. Add these comments to the php files in your theme, and you’ll be all set.

Trackbacks

  1. Solución al bug de WP 2.6 para las Plantillas de páginas | ..: CRISTIAN ESLAVA | Diseño Gráfico / Web | Maquetación | Flash | Multimedia | 3D | Fotografía :..
  2. Wordpress页面模板丢失解决办法 : 龙趣趣博客
  3. BibaBlog goes WordPress? « BibaBlog

Leave a Comment