Bird
0
0

You created a custom page template file named custom-template.php with the correct header comment, but it does not appear in the WordPress page editor template dropdown. What is the likely cause?

medium📝 Debug Q14 of 15
Wordpress - Custom Theme Development
You created a custom page template file named custom-template.php with the correct header comment, but it does not appear in the WordPress page editor template dropdown. What is the likely cause?
AThe page editor does not support templates
BThe template name comment is missing
CThe file has a syntax error in PHP code
DThe file is not in the active theme folder
Step-by-Step Solution
Solution:
  1. Step 1: Check template file location

    WordPress only detects custom templates inside the active theme's root folder or its subfolders.
  2. Step 2: Eliminate other causes

    The question states the header comment is correct, so B is unlikely. Syntax errors might cause errors but usually still show the template. The page editor supports templates by default.
  3. Final Answer:

    The file is not in the active theme folder -> Option D
  4. Quick Check:

    Template file must be inside active theme folder [OK]
Quick Trick: Place template file inside active theme folder to appear [OK]
Common Mistakes:
  • Placing template in plugin folder instead of theme
  • Forgetting to refresh page editor after adding template
  • Assuming page editor lacks template support

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes