Call to undefined function add_menu_page() on theme activation

I am attempting to activate a theme that works perfectly on one WordPress install. I have matched the plugins installed up and copied the theme over but when I go to activate it I get…

Fatal error: Call to undefined function add_menu_page() 

It points to the following line as being the cause of the error….

Read More
add_action('admin_menu', 'register_custom_menu');

function register_custom_menu() {
add_menu_page('Design', 'Design', 'delete_others_posts', '/nav-menus.php', '', get_stylesheet_directory_uri() . '/img/tv.png', '5.1' );
add_submenu_page( '/nav-menus.php', 'Widgets', 'Widgets', 'delete_others_posts', '/widgets.php', '' );
add_submenu_page( '/nav-menus.php', 'Nav Menu', 'Nav Menu', 'delete_others_posts', '/nav-menus.php', '' );
add_submenu_page( '/nav-menus.php', 'Event Options', 'Event Options', 'delete_others_posts', '/admin.php?page=mytheme-options', '' );
}

Can anyone see where I am going wrong?

Related posts

Leave a Reply