Bird
0
0

You want to add a custom navigation menu only in the footer area of your WordPress theme. Which is the best approach?

hard📝 component behavior Q8 of 15
Wordpress - Themes and Appearance
You want to add a custom navigation menu only in the footer area of your WordPress theme. Which is the best approach?
ARegister a new menu location and call wp_nav_menu() in footer.php
BAdd wp_nav_menu() call inside header.php
CUse get_header('footer') to load a footer header
DInsert menu HTML directly in functions.php
Step-by-Step Solution
Solution:
  1. Step 1: Register a new menu location

    Use register_nav_menus() in functions.php to create a footer menu location.
  2. Step 2: Display menu in footer.php

    Call wp_nav_menu() in footer.php to show the menu only in the footer area.
  3. Step 3: Evaluate other options

    Adding menu in header.php places it in header, not footer. get_header('footer') is invalid. Inserting HTML in functions.php is bad practice.
  4. Final Answer:

    Register a new menu location and call wp_nav_menu() in footer.php -> Option A
  5. Quick Check:

    Footer menu = register + wp_nav_menu in footer.php [OK]
Quick Trick: Register menu and call wp_nav_menu() in footer.php [OK]
Common Mistakes:
  • Placing menu in header.php
  • Misusing get_header() for footer
  • Hardcoding menu in functions.php

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes