0

I have created a college management menu in admin, under that i have added some sub menus those submenus are of different post types. Those were working fine. But Category and tags are not showing as sub-sub-menu under custom post types

College Management     /* Main menu */
 -- Faculty            /* Sub menu Custom post type */
 -- Courses            /* Sub menu Custom post type */
 -- News               /* Sub menu Custom post type */
    -- News Categories /* Sub Sub menu Custom post type Texonomy */
    -- News Tags       /* Sub Sub menu Custom post type Texonomy */
add_action('admin_menu', 'college_management_menu');

function college_management_menu() {
    add_menu_page('College Management', 'College Management', 'manage_options', 'college-management', 'college_management_callback_function', 'dashicons-building', 5);

    add_submenu_page('college-management', 'Stream', 'Stream', 'manage_options', 'edit.php?post_type=streams');
    add_submenu_page('college-management', 'Faculties', 'Faculties', 'manage_options', 'edit.php?post_type=faculty');
    add_submenu_page('college-management', 'Subjects', 'Subjects', 'manage_options', 'edit.php?post_type=subject');
    add_submenu_page('college-management', 'News', 'News', 'manage_options', 'edit.php?post_type=news');
//Not working
        ↓
    add_submenu_page('edit.php?post_type=news', 'News Category', 'News Category', 'manage_options', 'edit-tags.php?taxonomy=news_category');
//Not working
        ↓
    add_submenu_page('edit.php?post_type=news', 'News Tags', 'News Tags', 'manage_options', 'edit-tags.php?taxonomy=news_tags');
    add_submenu_page('college-management', 'Events', 'Events', 'manage_options', 'edit.php?post_type=event');
    add_submenu_page('college-management', 'Event Gallery', 'Event Gallery', 'manage_options', 'edit.php?post_type=event-gallery');
}

But it is not working. Whether if i will do show_in_menu = true then it is showing under the cpt News. Can someone instruct that how can i able to add it as a sub-submenu under the custom submenu.

5
  • So the only thing that is missing is the 3rd level menus (sub-sub-menus)? If so, you might want to investigate your CSS code. The 3rd level also might be hidden.
    – Nate
    Apr 20, 2017 at 12:11
  • I have inspected. But i didn't found there any submenu under the second level submenu.
    – Satrughna
    Apr 20, 2017 at 12:17
  • Check the PHP code where the menu is called. Maybe in its $args it has "depth" set
    – Nate
    Apr 22, 2017 at 17:55
  • Is there any argument to use depth in add_menu_page() function @Neit
    – Satrughna
    Apr 24, 2017 at 4:48
  • Actually i was searching and got that wordpress is not allowing admin 3rd level submenus. It might be the problem for not showing..
    – Satrughna
    Apr 24, 2017 at 6:54

1 Answer 1

1

WP Admin doesn't support 3 level menus in the side navigation. You can do this in WP Nav Menus on the frontend, but not with the main admin menu.

If you want to do this, you'll need to rebuilt the WP Admin menu and add the necessary styling, which will be a huge job

2
  • @Tuku if it answers the question can you mark as the correct answer?
    – Tom J Nowell
    Apr 24, 2017 at 13:48
  • Previously i commented the ans already.
    – Satrughna
    Apr 24, 2017 at 13:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.