How to have submenu in admin panel
-
Hello
I am a bit new with WordPress but I am very new in developpement.
I followed a tutorial in order to add a panel in the Dashboard.
(I installed a new instence of Word press)I added a menu name “My Panel” because of the following code.
I created a file name “wp-content/themes/twentyseventeen/my_panel.php” and I pasted the following code<?php add_action('admin_menu', 'my_pannel'); function my_pannel(){ //add_menu_page('My Profile','My profile', 'author', 'my-profile','render_profile', NULL, 81); add_menu_page('My pannel','My pannel', 'activate_plugins', 'my-pannel','render_pannel', NULL, 6); } function render_pannel(){ if(!empty($_POST)){ var_dump($_POST); } ?> <div class="wrap theme-options-page"> <div id="icon-options-general" class="icon32"><br></div> <h2>Welcome to your profile</h2> <quote>To update your profile, go to Profile</quote> <form action="" method="post"> <div class="theme-options-group"> <table cellspacing="0" class="widefat options-table"> <thead> <tr> <th colspan="2"> Education </th> </tr> </thead> <tbody> <tr> <th> From </th> <td> <input type="text" name="from"> </td> </tr> <tr> <th> Util </th> <td> <input type="text" name="until"> </td> </tr> <tr> <th> Institut </th> <td> <input type="text" name="institut"> </td> </tr> </tbody> </table> </div> <p class="submit"> <input type="submit" name="send_education" class="button-primary autowidth" value="save"> </p> </form> </div> <?php }
That work fine, because now I have a men My Panel below Posts.
My question is hjwo to create now a submenu ‘education’. For exemple
My Panel
— education
— researches
— projectsThat means that the above code will move to education section and not My Panel section as it is now.
many thank
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘How to have submenu in admin panel’ is closed to new replies.