Progmatically adding menu links to the default (Top) or Footer menu
You have to register the menu location first. Also, I’ve added else statement to be sure $menu_id is defined when menu exists. Otherwise, you’ll see the PHP Notice about undefined variable. WP_DEBUG must be turned on when you develop, that’s why you don’t see the notice. // Initialize name and location $menu_name=”Simple Inventory Menu”; $menu_location … Read more