Drupal - Getting a term count via a view

This snippet can be used within a view template to get a node count in a term that is passed via a view:

<?php

$tid = $fields['tid_1']->content; // replace this field with the field you pass in the view
print $tid_1;
$tcount = taxonomy_term_count_nodes($tid);

print $tcount;
?>

About the Author

Follow me on Twitter @karlbinder