Bird
0
0

You want to override a parent theme's header.php file in your child theme. Which is the correct way to do this?

hard📝 Application Q15 of 15
Wordpress - Theme Structure and Basics
You want to override a parent theme's header.php file in your child theme. Which is the correct way to do this?
ACreate a new file named <code>header-child.php</code> in the child theme
BEdit the parent theme's <code>header.php</code> directly
CCopy <code>header.php</code> from parent theme to child theme folder and modify it there
DAdd a <code>header.php</code> file in child theme but leave it empty
Step-by-Step Solution
Solution:
  1. Step 1: Understand override mechanism

    WordPress loads template files from child theme first if they exist.
  2. Step 2: Apply correct override method

    Copying header.php to child theme and editing it overrides the parent's version.
  3. Step 3: Eliminate wrong options

    Editing parent directly breaks update safety; naming differently or empty files won't override.
  4. Final Answer:

    Copy header.php from parent theme to child theme folder and modify it there -> Option C
  5. Quick Check:

    Child theme file overrides parent file [OK]
Quick Trick: Copy and edit parent file in child theme folder [OK]
Common Mistakes:
  • Editing parent theme files directly
  • Using different file names for overrides
  • Leaving override files empty

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes