Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Add menu item at the top of admin that links to URL WordPress


Hey, I need to know how to do the following:

1) Add a menu item to the top of the WP admin called "Support."
2) Link that to a specific URL
3) Change the background color and icon used


Answers (2)


timDesain Nanang answers:

* Constructs the admin menu.
* The elements in the array are :
* 0: Menu item name
* 1: Minimum level or capability required.
* 2: The URL of the item's file
* 3: undefined
* 4: Class
* 5: ID
* 6: Icon for top level menu :
* @global array $menu
* @name $menu
* @var array

add_action( 'admin_menu' , 'wpq_admin_menu_support' );
function wpq_admin_menu_support() {
global $menu;
$menu[1] = array(

add_action( 'admin_head' , 'wpq_admin_menu_head' );
function wpq_admin_menu_head() {
<style type="text/css">

Kyler Boudreau comments:


Your code worked - thank you!

2 questions if you're willing to answer:

1) How can I keep the font from turning blue on hover? I've tried everything with firebug and can't make it stay white.

2) Can the link open in a new tab?


timDesain Nanang comments:

You are welcome.
1. coloring

add_action( 'admin_head' , 'wpq_admin_menu_head' );
function wpq_admin_menu_head() {
<style type="text/css">
#adminmenu .menu-support{background-color:#f90;color:#fff;}
#adminmenu .menu-support:hover{background-color:#ff0;color:#000;}
#adminmenu .menu-support .wp-menu-image:before{color:#fff;}
#adminmenu .menu-support:hover .wp-menu-image:before{color:#000;}

2. no, it can't. there is no parameter to assign the link as _blank target

Kyler Boudreau comments:

thanks so much! voting now.

Kyler Boudreau comments:


Does this mean there could be a way for the new tab?

[[LINK href=""]][[/LINK]]


Ian Lincicome answers:

if u need help on this still, I wrote a detailed article about it at:
basically to add the menu item use:
add_action( 'admin_menu', 'addCustomMenuItem' );
function addCustomMenuItem(){
add_menu_page('Custom Admin Page Title', 'Custom Menu Title', 'manage_options', 'custom_admin_page_slug', 'pg_building_function','Icon_URL',3);
}//end addCustomMenuItem function.

Note: the 3 in the add_menu_page function all will force it to the top, but be careful it doesn't overwrite another menu item. I find that using 3 often puts it right below "dashboard"...

as far as linking to a specific url, I assume you mean a wordpress url, so u can do that in the call back function which would be the pg_building_function in the function call above.....but feel free to skype me to clarify and I'll be happy to explain. Also changing the icon can be done in the second last param in the add_menu_page function example above where i inserted "Icon_URL" before the 3.

...finally to change the background color, you can either do it in the image itself, or use firefox and right click and select "inspect code" to see what css you have to modify...again skype me and I'll explain further. I believe that should cover all points in your question;-)