Read the full article at: Add a Submenu to the WordPress Admin Bar A while back I wrote Add Menu Items to the WordPress Admin Menu, a post detailing how you can add items to the left side, existing posts menu bar. ?Adding menu items?has se
Read the full article at: Add a Submenu to the WordPress Admin Bar
A while back I wrote Add Menu Items to the WordPress Admin Menu, a post detailing how you can add items to the left side, existing “posts” menu bar. ?Adding menu items?has served me well but it’s not as customized as I would like — I’m still adapting to WordPress instead of WordPress adapting to me. ?By creating a custom top bar menu, I can mix and match links all I want!
Like adding functionality to your?theme and other admin?area,?the directives will go in your theme’s functions.php
file. ?The code itself should be self explanatory:
1 2 3 4 5 6 7 8 9 |
|
Setting an id
on the parent menu item allows you to use the parent
key for submenu items; the rest of the keys are easy to figure out. ?With the menu created, you simply need to add the WordPress hook and specificity to add it!