Bird
0
0

Which of the following is the correct syntax to display a menu assigned to the theme location 'primary'?

easy📝 Syntax Q3 of 15
Wordpress - Themes and Appearance
Which of the following is the correct syntax to display a menu assigned to the theme location 'primary'?
Ashow_menu('primary');
Bdisplay_menu('primary');
Cwp_nav_menu(array('theme_location' => 'primary'));
Dmenu_display('primary');
Step-by-Step Solution
Solution:
  1. Step 1: Recall the function to display menus

    WordPress uses wp_nav_menu() to output menus in themes.
  2. Step 2: Check the correct argument format

    The theme_location argument is passed as an array key to specify which menu to show.
  3. Final Answer:

    wp_nav_menu(array('theme_location' => 'primary')); -> Option C
  4. Quick Check:

    Display menu syntax = wp_nav_menu with theme_location [OK]
Quick Trick: Use wp_nav_menu with theme_location array to show menus [OK]
Common Mistakes:
  • Using non-existent functions like display_menu()
  • Passing theme_location as a string instead of array
  • Using incorrect function names like menu_display()

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Wordpress Quizzes