Bird
0
0

Which of the following is the correct way to add a custom menu registration in functions.php?

easy📝 Syntax Q12 of 15
Wordpress - Theme Structure and Basics
Which of the following is the correct way to add a custom menu registration in functions.php?
Aadd_menu('primary', 'Primary Menu');
Bregister_nav_menu('primary', 'Primary Menu');
Cregister_menu('primary', 'Primary Menu');
Dcreate_nav_menu('primary', 'Primary Menu');
Step-by-Step Solution
Solution:
  1. Step 1: Recall WordPress function for menu registration

    The correct function to register a navigation menu is register_nav_menu().
  2. Step 2: Check the syntax

    The syntax register_nav_menu('primary', 'Primary Menu'); matches WordPress standards, while other options use incorrect function names.
  3. Final Answer:

    register_nav_menu('primary', 'Primary Menu'); -> Option B
  4. Quick Check:

    Menu registration uses register_nav_menu() [OK]
Quick Trick: Use register_nav_menu() to add menus in functions.php [OK]
Common Mistakes:
  • Using non-existent functions like add_menu()
  • Confusing register_nav_menu() with register_menu()
  • Misspelling function names

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes