WordPress 2.7 Page Templates Not Working

,
  • Digg
  • Technorati
  • del.icio.us
  • Propeller
  • StumbleUpon
  • Reddit
  • Mixx
  • Fark
  • Slashdot
  • Sphinn
  • Design Float
  • DZone
  • BlinkList
  • email
January 14th, 2009 | News & Updates | 42 Comments

Today I was working on a few minor changes to my site’s design and I wanted to add a few custom page templates to the site. I have been working with WordPress for as long as I can remember and I have used custom page templates extensively in the past. However, today I ran into an apparent bug in the 2.7 version of WordPress.

Here’s the problem…

I uploaded the new custom page template files just like I have always done in the past, but this time they did not show up as options in the WordPress admin area when I went to edit my pages. Normally the drop-down in the page edit area will provide a list of available(correctly coded) page templates. But today, this was not the case.

I did the standard web designer routine…


First: I shouted at the computer and scared my dogs (they don’t understand why I yell at the computer).

Second: I checked and re-checked that I was not making any stupid mistakes.

Third: I visited the WordPress forums only to find a few others with similar problems and no solution.

Fourth: I switched themes and see if the same problem would happen in another theme… It did.

Fifth: I switched back to my main theme and… Presto! Suddenly the pages were showing up.

After doing a little testing I found that for some reason version 2.7 of WordPress is not finding new custom template pages automatically. It seems that currently the only way to get the script to recognize newly added template pages is by temporarily activating another theme and then switching back again. It is a major pain in the ass to say the least, but at least I found a solution and was able to finish what I was doing.

If you have also run into this problem, you likely did some Google searches and ended up here. I just hope you started with the searching online, rather than yelling at the computer like I did.

Welcome Back!

Now is your chance to join our growing community! Be the first to know about great new articles like this one. Register for my Email Updates or RSS Feed today!

About the Author

Zach is a marketing consultant and owner of a FL web design and marketing group. He offers graphic design and marketing services, speaks on Internet marketing, and blogs about it all in his free time. (»)

Contact Zach: Company Website | Email

Related Posts


Allow HTML in WordPress Author Bios

Multiple WordPress Sidebars

Optimizing Blogware Title Tags

IE PNG – The PNG Transparency Problem in Windows Internet Explorer

Optimizing Word Press Title Tags


42 Comments

  1. M

    January 16, 2009 @ 7:26 pm

    unfortunately i yelled at the computer also…ranted at it for a little while..until i finally found this post..then i became deeply paranoid i would lose everything if i changed theme…but it worked
    thanks man :)

    Reply

    zacheos

    Glad I could help!

    Reply

  2. Christopher Ross

    January 21, 2009 @ 1:34 pm

    Thanks! I’ve been staring at my blog for the last hour trying to work out what I was doing wrong.

    Reply

  3. Jeremy

    January 23, 2009 @ 1:31 pm

    I experienced the same problem. But changing themes ahs not jump-started my templates. They still aren’t showing up. I can see one that I uploaded a couple weeks ago, but not my new ones. Crap!

    Jeremy’s last blog post… Mass Transit in Metro Detroit

    Reply

  4. Jamiel Sharief

    January 29, 2009 @ 8:45 am

    I just experienced the same thing and I created numerous different templates, all the templates suddenly appeared once I changed to a different theme.

    Try switching themes, then quick edit the page to see if this works for you.

    Reply

  5. Richard

    January 30, 2009 @ 12:46 pm

    Worked like a charm… I was one step away from throwing my computer against the wall ;)

    Thanks!

    Reply

    zacheos

    Nice! I know the feeling… Nothing like KNOWING you are right and having the computer (or software, or browser, or database) disagree with you!

    Reply

  6. Aw Guo

    February 10, 2009 @ 8:34 am

    Hey thanks! It’s a very important tip for me!!!

    Aw Guo’s last blog post… Huge fire burning near CCTV headquarter building on Feb 9

    Reply

  7. Laura

    February 13, 2009 @ 11:59 am

    Thanks so much for this handy bit of information. I am currently using the plugin “Theme Test Drive” 2.7.2 by Vladimir Prelovac, and therefore was not working on the officially active theme, but your lovely solution still worked like a charm :-)

    Reply

  8. PeterVk

    February 16, 2009 @ 6:00 am

    Thanks for finding this. I can see absolutely no connection between temporarily switching themes and having new page templates be recognized. I don’t know if I would have found it myself. Cheers. Works perfectly.

    PeterVk’s last blog post… PeterVk: Seriously, Wordpress. I know you have a lot of bugs to fix, but please make this a priority: http://bit.ly/lbo77 머리 아파…

    Reply

  9. Amy @ Taste Like Crazy

    February 20, 2009 @ 10:56 am

    Blarg!

    I tried switching themes and still can’t get the stupid things to show up. Now I’m off to check to make sure that I haven’t made any coding mistakes. Based on the positive responses that you’ve gotten so far, I’m going to assume that I’m screwing up somewhere along the way. *sigh*

    Amy @ Taste Like Crazy’s last blog post… MilkBank – All in One Bottle

    Reply

    zacheos

    Good luck… Love your site by the way! Very interesting writing voice.

    Reply

    Amy @ Taste Like Crazy

    Thanks! Guess what? Totally worked. I was just being impatient. :)

    Amy @ Taste Like Crazy’s last blog post… Did You Say Shredder?

    Reply

  10. Runar

    February 25, 2009 @ 1:26 pm

    I found this in the FAQ:

    http://codex.wordpress.org/FAQ_Using_WordPress#Why_is_there_no_Page_Template_option_when_writing_or_editing_a_Page.3F

    Reply

    zacheos

    Thanks for the link… However, the problem is that sometimes this does not work like it is supposed to. For reasons beyond the scope of this article, WordPress 2.7 will fail to “see” new page templates have been added to the system. In this case, you will need to follow the steps provided above to force WordPress to “refresh” its view of the current directory structure.

    Reply

    Kamrul

    The real answer. thanks.

    Reply

  11. WordPress Custom Page Templates Not Showing In Dropdown Menu | Van SEO Design

    February 26, 2009 @ 11:02 pm

    [...] little searching directed me to this post by Zach Graeve with a very simple solution. The trick Zach describes is to temporarily switch to another theme and [...]

  12. Russ

    March 6, 2009 @ 4:52 am

    Thanks for this post. This had happened to me a couple of times before – I fixed it through sheer luck, but always forgot what the solution was. Considered this page bookmarked.

    Reply

  13. Andrew Kelley

    March 9, 2009 @ 9:09 pm

    My Page template dropdown in the wp 2.7 admin menu totally disappeared when I go to edit the page. When I quick edit, there is only default in the dropdown even though I have about half a dozen page templates which use to show up!!!

    Thanks in advance for your time and consideration!

    Reply

  14. Tim Sewell

    March 12, 2009 @ 10:26 am

    Thank you very much (although Dell won’t thank you as I would have had to buy a new computer after treating this one to the sledgehammer).

    Reply

  15. ZenGlen

    March 12, 2009 @ 7:29 pm

    Thank you Zach! I think you PREVENTED me from having problems with that. I am just about to do a bunch of custom templates for a customer. Would have been a little embarrasing to get delayed by such a quirky problem.

    Keep on rockin’ my man.

    Reply

  16. Himanshu

    March 24, 2009 @ 1:55 am

    yeah, I am too facing the same issue, this is an bug within wordpress 2.7.

    ~Himanshu~

    Himanshu’s last blog post… Recession hits dinosaurs

    Reply

  17. anjul bamhrolia

    March 28, 2009 @ 1:10 pm

    HELLO THERE
    I GOT A PROBLEM ,
    MY RECENT POST LINK IS DIFFERENT( SHOWING IN SIDE BAR) AND MY POST LINK IS DIFFERENT , SO WHEN SOME BODY CLICK ON MY RECENT POST LINK ,THEN IT DOESN’T OPEN MY POST PAGE PLS HELP ME (RECENT POST LINK LOKE LIKE”http://www.currentopics.com/?p=126″ AND MY ACTUAL POST LINK LOOK LIKE”http://www.currentopics.com/?paged=3″)

    Reply

  18. anjul bamhrolia

    March 28, 2009 @ 2:30 pm

    pls help me my comment page also not showing, all blank, and when i switch to an other theme it all blank NO POST NOTHING……. my email-anjforeva@gmail.com my blog-http://www.currentopics.com/

    anjul bamhrolia’s last blog post… What is Terrorism ?

    Reply

  19. Bradley

    March 29, 2009 @ 12:14 am

    Hey Zach -

    I tried your suggestion with no luck… any other ideas?

    Such a PITA!!!

    Bradley’s last blog post… Health Insurance Nightmares – Annual Rate Increases Too High To Keep Up With

    Reply

  20. Gianfranco

    March 31, 2009 @ 3:38 pm

    It is just not acceptable to have to do this kind of workaronds for something that should just work. The WordPress guys are better fixing this problem as soon as possible. We shouldn’t be happy to find a solution for such a problem. We should all be mad that we have to waste a lot of time trying to figure things (bugs) out and to look for solutions on the net. It should just work, shouldn’t it? My point is that we should make some noise in the ears of the WordPress people, instead of just saying, oh, ok I found a way to make it work. Switching theme every time you want to apply a template to a page? C’mon! It just drives me crazy, when a basic function don’t work the way it is menat to.

    Reply

  21. Gianfranco

    March 31, 2009 @ 3:55 pm

    Just found a very weird fix to the “template dropdown menu” not showing under the “attribute box” in “pages”. Actually, in my “style.css” file I had something written for “template”.

    /*
    Theme Name:
    Theme URI:
    Description:
    Author:
    Author URI:
    Template:
    Version: 2.0
    */

    I just removed it and the “template” function just work. When I write something in the “template” line, the function is broken again. Weird!

    Reply

    zacheos

    That is very strange indeed… I would have to do a bit of testing to understand why the style sheet would be related to this bug.

    Reply

  22. Jacqueline

    April 17, 2009 @ 8:00 am

    I’m gonna try this before I go totally doolally

    Reply

  23. mssmotorrd

    May 3, 2009 @ 5:52 am

    It’s the first time I commented here and I must say you share us genuine, and quality information for bloggers! Good job.
    p.s. You have a very good template for your blog. Where did you find it?

    Reply

    zacheos

    Thanks for reading my blog! I run this site as nothing more than a hobby, so it is always nice to hear that my efforts are appreciated. This site was of course designed by me, and if you read it often you know that I am always changing it. Give it a couple of months and I am sure I will change it again.

    Reply

  24. AMP

    May 4, 2009 @ 7:01 pm

    Thank you! This has been confounding me for the last 30 minutes or so.

    I actually even thought to toggle themes, but then I thought, “Nah, that’s too easy, and it doesn’t make sense.” Go figure.

    Reply

  25. Sterling Okura

    May 4, 2009 @ 11:34 pm

    Thanks for posting the solution. Saved me some headaches. Can’t believe that Wordpress doesn’t have a better option for refreshing page templates.

    You rock!

    Reply

  26. Sean

    May 5, 2009 @ 4:57 pm

    Thanks for your help!

    Reply

  27. Art Insight TV

    May 21, 2009 @ 11:29 am

    Thanks Zach! I’ve had that issue on two sites now. Hopeful never again! Time to go a make the donuts and swap themes.

    Thanks

    Art Insight TV’s last blog post… John Singer Sargent

    Reply

  28. mark

    June 21, 2009 @ 9:58 pm

    Thanks Zach, this was an instant fix to a realy anoying problem. Simple, switch themes and switch back and bobs your uncle!! cheers

    mark’s last blog post… Saving images for email & the web

    Reply

  29. Gareth Dickey

    August 22, 2009 @ 3:30 am

    Cheers Zach, great post mate. Worked a treat. Freaking weird bug!

    Reply

  30. Kalle

    September 7, 2009 @ 4:59 am

    Thanks!
    Great help.

    Reply

  31. Harvey Ramer

    December 9, 2009 @ 2:06 pm

    Thanks very much for this. I had the same problem with 2.8.6. This fixed it.

    Reply

  32. Echo

    December 10, 2009 @ 7:09 pm

    THANK YOU SOOOOO MUCH!!! SAVED ME A BUNCH OF TIME!

    Reply

  33. Derek

    January 10, 2010 @ 9:04 am

    You just saved me so much trouble! Thank goodness I only goofed around with it for 20 minutes before firing up Google.

    Looks like the bug still exists in 2.9.1. First time ever encountering it, and I’ve been playing around with Wordpress since about version 2.6.

    Reply

  34. Anton Korzhuk

    January 20, 2010 @ 9:26 pm

    thanks! step 5 was a real live saver, saved me the freak out time.heh

    Reply

RSS feed Comments | TrackBack URI

Write Comment