Reputation: 111
I made pretty good menu and sub menu in word press but when i click on menu (jobify) it says URL not found . My sub menus are working fine .
<?php
//adding custom admin menu add_action("admin_menu", "addMenu");
// function of custom admin menu function addMenu() { add_menu_page("Jobify Menu", "Jobify", "manage_options", "jobifyAdminMenu",'', null, 3); add_submenu_page('jobify.php', 'user', 'User', 'manage_options', 'userSubMenu','user_manage'); add_submenu_page('jobify.php', 'jobs', 'Jobs', 'manage_options', 'jobsSubMenu','jobs_mangae'); add_submenu_page('jobify.php', 'setting', 'Setting', 'manage_options', 'settingSubMenu','setting_manage'); }
function user_manage() {
include plugin_dir_path( __FILE__ ) . 'user.php';
}
?>
Upvotes: 0
Views: 760
Reputation: 385
You forget the menu slug hence you getting error .
add_menu_page("Jobify Menu", "Jobify", "manage_options",$menu_slug, "jobifyAdminMenu", null, 3);
For example :
add_action( 'admin_menu', 'register_my_custom_menu_page' );
function register_my_custom_menu_page() {
add_menu_page( 'custom menu title', 'custom menu', 'manage_options', 'myplugin/myplugin-admin.php', '', plugins_url( 'myplugin/images/icon.png' ), 6 );
}
Upvotes: 0