Theme multiple rendered nodes as item_list I am retrieving/rendering multiple nodes successfully with the following code:

$nodes = node_load_multiple($nids);

$rendered_nodes = node_view_multiple($nodes, 'custom_view_mode');

return render($rendered_nodes);


I would like these nodes to be rendered as an item list. I have attempted to set the #theme property of the array to 'item_list' but it does not seem to be working. What is the correct way to theme this array of nodes returned by node_view_multiple()?
This should render multiple nodes using an item list.

$nodes = node_load_multiple($nids);
$build = array(
    '#theme' =&gt; 'item_list',
    '#items' =&gt; array_filter(reset(node_view_multiple($nodes)), function(&amp;$node) {
        if (!is_array($node)) {
            return false;
        }

        $node = drupal_render($node);
        return true;
    }),
);

return drupal_render($build);