Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have added the below function in my functions.php in theme folder.. and i refreshed my wp-admin page.. but the sub-menu is not coming

add_action('admin_menu', 'register_custom_menu_page');

function register_custom_menu_page()
{
   add_menu_page('View Orders', 'View Orders', '', 'orders/vieworder.php', '', plugins_url('orders/small_cart_icon_20.gif'), 100);
   add_submenu_page( 'orders/vieworder.php', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'orders/vieworder.php' ); 
}
share|improve this question

1 Answer 1

up vote 0 down vote accepted

The Below Code Work's Clearly

add_action('admin_menu', 'register_custom_menu_page');

function register_custom_menu_page()
{
   add_menu_page('Shopping Cart', 'Shopping Cart', '', 'orders/sphsettings.php', '', plugins_url('orders/small_cart_icon_20.gif'), 100);
   add_submenu_page( 'orders/sphsettings.php', 'Coupon Manager', 'Coupon Manager', 'manage_options', 'orders/couponmanager.php', 'orders/couponmanager.php' ); 
   add_submenu_page( 'orders/sphsettings.php', 'Order Manager', 'Order Manager', 'manage_options', 'orders/ordermanager.php', 'orders/ordermanager.php' ); 
   add_submenu_page( 'orders/sphsettings.php', 'Shopping Cart Settings', 'Shopping Cart Settings', 'manage_options', 'orders/shopsettings.php', 'orders/shopsettings.php'); 
   remove_submenu_page( 'orders/sphsettings.php', 'orders/sphsettings.php' );
}
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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