2009-08-28, 01:52:03
Kumar, after you get the array back, YOU have to loop through it and build the unordered list / menu structure. Here is how I did it. I created a functions.php file in my theme folder and included it in my theme. Next, I put this function in my functions.php file.
In my theme file, I added
This isn't the only way to do it or even the best way, but it worked for me.
Regards,
Brian
Code:
function getMenu() {
$data = menu_data();
$output = array();
$output[] = '<ul>';
foreach( $data as $menu) {
$output[] = "<li><a href='" . $menu['url'] . "' title='" . $menu['title'] . "'>" . $menu['title'] . "</a></li>";
}
$output[] = '</ul>';
$menu_string = implode("\n", $output);
echo $menu_string;
}
In my theme file, I added
Code:
<?php getMenu();?>
This isn't the only way to do it or even the best way, but it worked for me.
Regards,
Brian