Bird
0
0

You want to override a parent theme's functions.php to add new features but keep the parent's functions intact. What is the best practice?

hard📝 Application Q9 of 15
Wordpress - Theme Structure and Basics
You want to override a parent theme's functions.php to add new features but keep the parent's functions intact. What is the best practice?
AAdd new functions in child theme's <code>functions.php</code> without removing parent's file
BCopy parent's <code>functions.php</code> to child and modify it directly
CRename parent's <code>functions.php</code> to disable it and add new one in child
DDelete parent's <code>functions.php</code> and create a new one in child
Step-by-Step Solution
Solution:
  1. Step 1: Understand how WordPress loads functions.php

    Parent theme's functions.php loads first, then child's functions.php.
  2. Step 2: Add new features safely

    Child theme should add new functions without copying or deleting parent's file to keep parent's features.
  3. Final Answer:

    Add new functions in child theme's functions.php without removing parent's file -> Option A
  4. Quick Check:

    Child functions.php adds features, parent remains loaded [OK]
Quick Trick: Add new code in child functions.php, don't copy parent's file [OK]
Common Mistakes:
MISTAKES
  • Copying and modifying parent's functions.php causing maintenance issues
  • Deleting or renaming parent's functions.php breaking theme
  • Trying to override functions by redefining them

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes