Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress

Boris Kamp
Boris Kamp
16,660 Points

Page templates not recognized in wordpress

Hey guys,

I have been busy building a Wordpress site and have been working working with custom page templates like this:

<?php /*Template Name: Mijn AWF*/ ?>

the file itself is named page-mijnawf.php and located in the theme's root. It was working correctly, Im 100% sure of that. Somehow it stopped working and now Im unable to use the templates. The pages I created in the meantime still work tho, so I have no idea what's causing this strange issue! do you guys have any idea where to start?

Thanks!

2 Answers

Andrew Shook
Andrew Shook
31,709 Points

Boris, I used the code you pasted above and It worked for me. Did you recently update wordpress? I've read articles in the past about stuff like this happening when people updated. If so, download a fresh WP install, make a copy of your wp-content folder, and then replace you current install with the fresh one. After you do the replacement, taken all the files from the copied wp-content folder and place them in the empty wp-content folder of the fresh install.

Boris Kamp
Boris Kamp
16,660 Points

Sounds like a good suggestion but unfortunately that does not work... Here's what I did:

  1. Created a copy of the local Wordpress folder
  2. Emptied the local WP folder and put the content of the fresh downloaded WP 4.0 inside.
  3. Deleted the wp-content folder in here and replaced it with the one of my copy from step 1.
  4. Edited the wp-config file to match again.

after this I checked in the backend and page templates still won't show up! This got me so confused.

Thanks for trying to help me out again!

Boris Kamp
Boris Kamp
16,660 Points

Do you have any idea on what might be going on here Andrew Shook ?