WordPress 2.7 Page Templates Not Working
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.










January 16, 2009 at 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
January 18, 2009 at 3:29 pm
Glad I could help!
January 21, 2009 at 1:34 pm
Thanks! I’ve been staring at my blog for the last hour trying to work out what I was doing wrong.
January 23, 2009 at 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
January 29, 2009 at 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.
January 30, 2009 at 12:46 pm
Worked like a charm… I was one step away from throwing my computer against the wall
Thanks!
January 30, 2009 at 12:58 pm
Nice! I know the feeling… Nothing like KNOWING you are right and having the computer (or software, or browser, or database) disagree with you!
February 10, 2009 at 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
February 13, 2009 at 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
February 16, 2009 at 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 머리 아파…
February 20, 2009 at 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
February 20, 2009 at 11:21 am
Good luck… Love your site by the way! Very interesting writing voice.
February 20, 2009 at 1:56 pm
Thanks! Guess what? Totally worked. I was just being impatient.
Amy @ Taste Like Crazy’s last blog post… Did You Say Shredder?
February 25, 2009 at 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
February 26, 2009 at 7:58 am
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.
November 29, 2009 at 11:36 am
The real answer. thanks.
February 26, 2009 at 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 [...]
March 6, 2009 at 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.
March 9, 2009 at 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!
March 12, 2009 at 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).
March 12, 2009 at 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.
March 24, 2009 at 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
March 28, 2009 at 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″)
March 28, 2009 at 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 ?
March 29, 2009 at 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
March 31, 2009 at 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.
March 31, 2009 at 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!
March 31, 2009 at 8:07 pm
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.
April 17, 2009 at 8:00 am
I’m gonna try this before I go totally doolally
May 3, 2009 at 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?
May 3, 2009 at 9:53 am
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.
May 4, 2009 at 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.
May 4, 2009 at 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!
May 5, 2009 at 4:57 pm
Thanks for your help!
May 21, 2009 at 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
June 21, 2009 at 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
August 22, 2009 at 3:30 am
Cheers Zach, great post mate. Worked a treat. Freaking weird bug!
September 7, 2009 at 4:59 am
Thanks!
Great help.
December 9, 2009 at 2:06 pm
Thanks very much for this. I had the same problem with 2.8.6. This fixed it.
December 10, 2009 at 7:09 pm
THANK YOU SOOOOO MUCH!!! SAVED ME A BUNCH OF TIME!
January 10, 2010 at 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.
January 20, 2010 at 9:26 pm
thanks! step 5 was a real live saver, saved me the freak out time.heh
April 8, 2010 at 12:00 pm
Nice one, really helped me out. Looks like the same issue occurs if you delete the default stylesheet from the theme directory too.
April 23, 2010 at 11:27 am
Thanks!!!!!!!!!!!!!!!! It works!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
I’ve spent 5 hours to find what is wrong!
May 20, 2010 at 3:55 pm
Thank you so much. I was starting to lose my mind. I've been working with WordPress for years and haven't run into this issue yet. A simple template change and then back and viola. By the by I know this is an older post this also works with the newest version of WordPress 2.9.2. Thanks a ton:)
July 9, 2010 at 10:47 am
Thanks a lot for the tips. It works!
August 6, 2010 at 8:17 am
The bug still remains in 3.0.1I did it and the dropwdown worked.. although my main menu is now a disaster!
October 14, 2010 at 7:48 am
Am pretty sure its now working on its later version.
November 9, 2010 at 4:26 pm
Thankyouthankyouthankyou! Was convinced that I was just NOT getting it!
August 25, 2011 at 9:39 pm
It looks like I have this problem too. I have wordpress website where new templates don’t appear. Tried switching themes no joy … Puzzled.
November 1, 2011 at 8:07 pm
Had the same problem today, not sure what triggered it as I was editing some template files and the box disappeared.
Switching themes back and forth did NOT fix it. I had to delete my custom theme folder from the server and upload it again.
Thanks for this article, it put me on the right track of knowing it is WordPress misbehaving, so I did not have to wrestle with the code for hours thinking I broke something.
December 5, 2011 at 1:09 am
THANK YOUUUUU I LOVE YOUUUU!!! You saved me!
August 6, 2012 at 10:14 am
Hi, Well, I am having many themes installed in the single wordpress installation. But the above trick does not work for me.
August 14, 2012 at 5:59 am
thanks man i only did fourth and fifth process and i got the templates