views:

162

answers:

1

When you create a custom theme in WordPress, you can add a link to your theme options on the left menu in the WP dashboard. The default icon that's used next to your menu label is called generic.png and resides in the wp-admin/images directory.

Anyone know how to tell WP to use my theme's custom favicon.png instead of the default?

A: 

I figured this one out. Hopefully it can help others:

add_menu_page('Page title', 'Top-level menu title', 
'administrator', 'my-top-level-handle',
'my_magic_function','../wp-content/themes/yourTheme/img/favicon.png');

You can also add a submenu under your theme's main menu item like so...

add_submenu_page( 'my-top-level-handle', 'Page title',
'Sub-menu title', 'administrator', 'my-submenu-handle', 'my_magic_function')
Scott B
this is good, but please change '../wp-content/themes/yourTheme/img/favicon.png' into a better one. as you know it, in wordpress, a blog owner can change wp-content location.
justjoe
Thanks JJ, I was not aware of the ability to change wp-content. I've personally never encountered it. If you don't mind, what would your suggestion be to handle that exception?
Scott B
Presumably jj means something like thisbloginfo('stylesheet_directory')/img/favicon.png
Jared