/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $i = 0; $item = menu_get_item(); $tree = menu_tree_page_data('primary-links'); while ($curr) { // Terminate the loop when we find the current path in the active trail. if ($curr['link']['href'] == $item['href'] || $i++ > 2) { $tree = $curr['below']; $curr = FALSE; } else { // Add the link if it's in the active trail, then move to the link below. if ($curr['link']['in_active_trail']) { } } } foreach ($tree AS $key => $val){ if ($val['link']['in_active_trail']){ $tree_int = $val['below']; break; } } $menuhtml = theme_menu_tree(menu_tree_output($tree_int)); print $menuhtml; ?>