Custom theme function and template suggestion I'm trying to create a theme function, with a template:

/**
 * Implements hook_theme().
 */
function mycustomtheme_theme($existing, $type, $theme, $path) {
  return array(
    'custom_function' =&gt; array(
      'template' =&gt; 'my-template',
    ),
  );
}    


The my-template.tpl.php file is in the module directory and it works, I have added this to my page.tpl.php:

&lt;?php print theme('custom_function', array()); ?&gt;


I've tried to copy that template on my theme, but it doesn't work, Drupal always reads the module template, not the theme.

Have I forgotten something?
/**
 * Implements hook_theme().
 */
function mycustomtheme_theme($existing, $type, $theme, $path) {
  return array(
    'custom_function' =&gt; array(
      'template' =&gt; 'my-template',
      'path' =&gt; path_to_theme(),
    ),
  );
}

OR for the my-template.tpl.php file is in the module directory

/**
 * Implements hook_theme().
 */
function mycustomtheme_theme($existing, $type, $theme, $path) {
  return array(
    'custom_function' =&gt; array(
      'template' =&gt; 'my-template',
      'path' =&gt; drupal_get_path('module', 'mycustomtheme'),
    ),
  );
}