Usa un alias per la restituzione di COUNT funzione:
$countThemes = Singlequery('SELECT COUNT(1) AS num_items FROM items WHERE type = :type',
array(':type' => 'theme'), $conn);
Quindi, il tuo array dovrebbe avere l'indice num_items invece di COUNT(1) .