Use theme folder instead of plugins_url

I imagine this is really simple but I can’t work it out. I am trying to add a menu page to the WordPress dashboard through my theme. I have the following…

add_menu_page( 
    'Test', 
    'Test', 
    'manage_options', 
    'myplugin/myplugin-admin.php', 
    '', 
    plugins_url( 'myplugin/image/icon.png' ), 
    6 
);

Which works, but I want to use an icon in my themes directory instead of plugin. How can I alter this to look in there instead? I have tried using theme_url instead but it’s not working.

Related posts

2 comments

  1. get_template_directory_uri() should be used to get parent theme directory URI.
    get_stylesheet_directory_uri() should be used to get child theme directory URI.

Comments are closed.