Forums

[resolved] Add link to Admin Panel? (9 posts)

  1. do77
    Member
    Posted 2 years ago #

    Hey guys,

    is there a plugin that let's you add a link to the admin panel? I haven't found one yet.
    I mean I could probably simply edit one of the admin files that contains the sidebar but I am not quite sure if that's the best idea.

    What do you guys think? Any suggestions?

  2. xcded
    Member
    Posted 2 years ago #

    And the CODEX say again Adding Administration Menus.

  3. sanjaymenon
    Member
    Posted 2 years ago #

    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');
    ?>
  4. do77
    Member
    Posted 2 years ago #

    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

  5. do77
    Member
    Posted 2 years ago #

    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

  6. xcded
    Member
    Posted 2 years ago #

    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.

  7. do77
    Member
    Posted 2 years ago #

    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

  8. do77
    Member
    Posted 2 years ago #

    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

  9. dtoumi
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.