Bird
0
0

You created a template file named single-post.php but WordPress still uses single.php to display posts. What is the likely problem?

medium📝 Debug Q14 of 15
Wordpress - Theme Structure and Basics
You created a template file named single-post.php but WordPress still uses single.php to display posts. What is the likely problem?
AThe file name should be <code>single-post.php</code> but WordPress uses <code>single-{post-type}.php</code> where {post-type} is the actual post type slug
BThe correct file name is <code>single-post.php</code> but it must be in a subfolder
CThe file should be named <code>single.php</code> for posts
DWordPress does not support <code>single-post.php</code> templates
Step-by-Step Solution
Solution:
  1. Step 1: Understand post type template naming

    WordPress uses single-{post-type}.php where {post-type} matches the post type slug exactly.
  2. Step 2: Check post type slug for 'post'

    The default post type slug is 'post', so single-post.php is correct if the post type is 'post'. But if the post type is custom or named differently, the file name must match exactly.
  3. Step 3: Identify common mistake

    If WordPress ignores single-post.php, it may be because the post type slug is not 'post' or the file is misplaced.
  4. Final Answer:

    File name must match actual post type slug in single-{post-type}.php -> Option A
  5. Quick Check:

    Template file must match post type slug exactly [OK]
Quick Trick: Match single-{post-type}.php exactly to post type slug [OK]
Common Mistakes:
MISTAKES
  • Assuming single-post.php always works for posts
  • Thinking file must be in a subfolder
  • Believing WordPress ignores single-{post-type}.php files

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes