Bird
0
0

You want to override a parent theme's footer.php but also include the parent's footer content inside your child theme's footer. How should you do this?

hard📝 Application Q8 of 15
Wordpress - Theme Structure and Basics
You want to override a parent theme's footer.php but also include the parent's footer content inside your child theme's footer. How should you do this?
ACreate <code>footer.php</code> in child theme and call <code>get_template_part('footer', 'parent')</code>
BCreate <code>footer.php</code> in child theme and call <code>include( get_template_directory() . '/footer.php' );</code> inside it
CCreate <code>footer.php</code> in child theme and call <code>get_template_part('footer', null, ['parent'])</code>
DCreate <code>footer.php</code> in child theme and call <code>get_template_part('footer', '', ['parent'])</code>
Step-by-Step Solution
Solution:
  1. Step 1: Understand how to load parent template specifically

    Use get_template_directory() . '/footer.php' to get the parent footer path directly.
  2. Step 2: Include parent's footer inside child footer

    Inside child footer.php, call include( get_template_directory() . '/footer.php' ); to include parent's footer content.
  3. Final Answer:

    Create footer.php in child theme and call include( get_template_directory() . '/footer.php' ); inside it -> Option B
  4. Quick Check:

    include parent footer path directly [OK]
Quick Trick: Use include( get_template_directory() . '/footer.php' ) to include parent footer [OK]
Common Mistakes:
  • Using incorrect parameters for get_template_part
  • Expecting get_template_part to load parent automatically without call
  • Trying to pass parent as argument incorrectly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes