Reputation: 520
I'm working with custom post type. I want to use custom menu image for the post type. I know 'menu_icon' => '' should work but couldn't recognize how image path should be specified. I appreciate your help.
Upvotes: 1
Views: 2735
Reputation: 31
Other way to do it, if the image you want to add is located in your theme directory, would be:
'menu_icon' => get_template_directory_uri() . '/images/your_custom_icon.png',
Upvotes: 0
Reputation: 19992
It is better to give the full path to the image. Something like this
'menu_icon' => get_bloginfo('template_directory') . '/images/portfolio-icon.png'
Edit: If you want to include the image from the Plugin directory, then you can use the plugin_url() function. This will make it compatible with WPMU as well.
'menu_icon' => plugins_url('path/to/image', __FILE__);
Upvotes: 2