Why is my theme function not called (not in template file)? I have a simple theme and everything is by documentation/examples:

function activit_theme() {

  return array(

      'activit_package_teaser' =&gt; array(
          'arguments' =&gt; array('node' =&gt; NULL),
          'type' =&gt; 'module'
      ),

  );
}


+

function theme_activit_package_teaser($node) {

  $output = '
    &lt;div class="package-teaser"&gt;
      package  
    &lt;/div&gt;
  ';

  return $output;
}


and 

function activit_packages_block() {

  $nids = db_select('node', 'n')-&gt;fields('n', array('nid', 'status'));
  $nids-&gt;join('field_data_field_important', 'f', 'f.entity_id = n.nid');
  $nids-&gt;fields('f', array('field_important_value', 'entity_id'));
  $nids-&gt;condition('n.status', 1)-&gt;condition('f.field_important_value', 1);
  $nids = $nids-&gt;execute()-&gt;fetchCol();

  $nodes = node_load_multiple($nids);

  $packages = '';
  foreach($nodes as $node) {
    $packages .= theme('activit_package_teaser', array('node' =&gt; $node));
  }

  return '
    &lt;div class="important-packages wrapper"&gt;
      &lt;h2&gt;'.t('Important packages').'&lt;/h2&gt;

      &lt;div class="cont"&gt;
        '.$packages.'
      &lt;/div&gt;    
    &lt;/div&gt;
  ';

}


there are 4 nodes, but my theme is not called at all and nothing is inserted into &lt;div class="cont"&gt;&lt;/div&gt;. No error in "recent log messages".  Why it does not work?



UPDATE: When the template is in activit_package_teaser.tpl file it works:

  'activit_package_teaser' =&gt; array(
      'arguments' =&gt; array('node' =&gt; NULL),
      'template' =&gt; 'activit_package_teaser',
      'path' =&gt; drupal_get_path('theme', 'activit') . '/templates/',
  ),


But why it does not work as a theme function?
arguments was for Drupal 6, you need to use variables for Drupal 7.  One of variables or render element is required, hence nothing is showing up at the moment as the item isn't making it into the theme registry.

function activit_theme() {

  return array(

      'activit_package_teaser' =&gt; array(
          'variables' =&gt; array('node' =&gt; NULL),
          'type' =&gt; 'module'
      ),

  );
}