How to Add Dynamic Menu on WordPress without Plugins

Menu File

Add simple code and show dynamic menus of your WordPress website. You can easily add menu options without any types of plugin.

How to add Dynamic Menu

  • Open your active theme’s functions.php file.
  • Paste code then SAVE.
 register_nav_menus(
array(
'menu-1' => esc_html__( 'Primary', 'thekroyaard_spl' ),
)
);
  • Then Open header.php or paste where you want to show Menu.
  • Paste given code and SAVE.
 <?php
wp_nav_menu(
array(
'theme_location' => 'menu-1',
'menu_id' => 'primary-menu',
)
);
?>

Hope this code worked. Have another type of help so Contact us. thank for visiting.