Print only parent terms of your chosen vocabulary

This will print out a list of parent taxonomy terms as links from your chosen vocabulary.

Snippet:

<?php
$vid
= 1;
$terms = taxonomy_get_tree($vid);
print
'<div id="menu"><ul>';
foreach (
$terms as $term) {
if (
$term->depth == 0) {
print
"<li>".l($term->name,'taxonomy/term/'.$term->tid, array('title' => $term->name))."</li>";
}
}
print
'</ul></div>';
?>