use this plugin : (it’ll add a new menu item in your admin panel)
<?php
/*
Plugin Name: Add-Admin-Menu
Author: Sanjay Menon
*/
function mt_add_pages() {
// The first parameter is the Page name(admin-menu), second is the Menu name(menu-name)
//and the number(5) is the user level that gets access
add_menu_page('admin-menu', 'menu-name', 5, __FILE__, 'mt_toplevel_page');
}
// mt_oplevel_page() displays the page content for the custom Test Toplevel menu
function mt_toplevel_page() {
echo '
<div class="wrap">
<h2>New admin menu</h2>
<li><a href="http://www.icore.net.tc"><h3>Author Homepage</h3></a></li>
</div>';
}
add_action('admin_menu', 'mt_add_pages');
?>
Thread Starter
do77
(@do77)
Thanks guys,
the plugin doesn’t work for me since it doesn’t go with one of my plugins (Custom Admin Branding). I guess I will take a look at xcded’s link. Thanks!
do77
Thread Starter
do77
(@do77)
Okay, when I upload the sample plugin that it shows in the codex I get the same error message when activating.
Fatal error: Cannot redeclare mt_add_pages() (previously declared in /home/content/d/o/h/dohosting/html/oneworld/wp-content/plugins/custom-admin-branding/custom_branding.php:15) in /home/content/d/o/h/dohosting/html/oneworld/wp-content/plugins/back_button.php on line 17
Does anyone knows what I can/have to do?
do77
No need to create a plugin.
You just have to put that piece of code in “functions.php” file inside your WordPress Theme.
function mt_add_pages() {
add_menu_page('admin-menu', 'menu-name', 5, __FILE__, 'mt_toplevel_page');
}
function mt_toplevel_page() {
echo '
<div class="wrap">
<h2>New admin menu</h2>
<li><a href="http://www.icore.net.tc"><h3>Author Homepage</h3></a></li>
</div>';
}
add_action('admin_menu', 'mt_add_pages');
Complement this with the CODEX info, and you will crete custom admin menu’s for your themes. And if we helped you, please, change this post to [resolved]. Bye.
Thread Starter
do77
(@do77)
It works the way you say xceded. But unfortunately it is not working the plugin ‘Custom Admin Branding’ (I probably have to find another way to change the color + Logo of my header/footer). I was also wondering if you have an idea how to make the new menu sticky? I want to hide every menu, like dashboard etc. but keep this one. When I use ‘adminimize’ it will also hide the new menu from my authors.
do77
Thread Starter
do77
(@do77)
Found the right css to change the header w/o using the plugin. Thanks xcded! This way your code totally works for me! In case you have an idea about how to make the menu sticky that would be great.
So far, topic RESOLVED! 🙂
do77