X

Create Custom Admin Panel with add_menu_page

Snippets by IsItWP

Are you looking for a way to add a new admin menu linking to custom admin panel? For customization in WordPress admin menu settings, we have created a quick code snippet that you can use create custom admin panel with add_menu_page.

Instructions:

All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

add_action('admin_menu', 'create_custom_panel');
function create_custom_panel() {
    add_menu_page('Custom panel', 'Custom panel', 'manage_options', 'custom-panel', 'custom_panel');
}

function custom_panel(){
		echo '<div class="wrap"><div id="icon-options-general" class="icon32">
			<br>
		</div>
		<h2>Custom panel</h2></div>';
}

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly add code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 9 best WordPress help desk plugins and 50+ best responsive WordPress themes.

Comments  Leave a Reply

  1. how could you add a few custom posts into this menu?

  2. For example Can I include post.php on this page? How is that done?

    1. Can you elaborate ?

      1. Hello
        I don’t understand what you say !!!For example, how can I execute commands post.php on this page?

        1. Hi N3sted I need more detail before I can help, commands post.php i’m not sure what you mean.

        2. thanks for the follow-up response
          in this panel,how can I call the command post or other command ?

  3. Thank you I found the solution

  4. Thank you I found the solution

  5. How can I customize this page to edit  ” ?page=custom-panel ” ?

  6. How can I customize this page to edit  ” ?page=custom-panel ” ?

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[63% OFF Today!]
[60% OFF Today!]
[60% OFF Today!]
[50% OFF Today!]
[50% OFF Today!]