开发者

menu_icon not displaying

开发者 https://www.devze.com 2023-02-12 17:35 出处:网络
I have a custom post_type created in wordpress admin control panel. all is working just fine except the menu_icon

I have a custom post_type created in wordpress admin control panel. all is working just fine except the menu_icon

'menu_icon' => get_stylesheet_directory_uri() . '/images/my_menu_icon.png',

it's not loading at all... the image file is located in my_theme/images

开发者_开发百科

is there a code instead to use the template directory for the menu_icon? or do i need to save the image file somewhere else?

I have no clue..

thanks!


Try this:

'menu_icon' => get_bloginfo('template_directory'). '/images/my_menu_icon.png',


I finally figured out what is wrong.

Never name you theme with a space (%20). As the local host wont recognize it within the functions.php when using the template directory or stylesheet uri.

So both code will work for the menu icon display.

Cheers!

0

精彩评论

暂无评论...
验证码 换一张
取 消