diff --git a/view/common/wordpress-menu.phtml b/view/common/wordpress-menu.phtml
index c6b0549..9b9041b 100644
--- a/view/common/wordpress-menu.phtml
+++ b/view/common/wordpress-menu.phtml
@@ -39,22 +39,22 @@ if ($wordpress_endpoint) {
}
}
}
-
//print_r($items);
-function render_menu($items, $level_id) {
- echo '
' . PHP_EOL;
- foreach ($items[$level_id] as $menu_item) {
- echo '- ' . PHP_EOL;
- echo ''.$menu_item['title'].'' . PHP_EOL;
- if (array_key_exists($menu_item['id'], $items)) {
- render_menu($items, $menu_item['id']); // render sub menu
+if (!function_exists('render_menu')) {
+ function render_menu($items, $level_id) {
+ echo '
' . PHP_EOL;
+ foreach ($items[$level_id] as $menu_item) {
+ echo '- ' . PHP_EOL;
+ echo ''.$menu_item['title'].'' . PHP_EOL;
+ if (array_key_exists($menu_item['id'], $items)) {
+ render_menu($items, $menu_item['id']); // render sub menu
+ }
+ echo '
' . PHP_EOL;
}
- echo '
' . PHP_EOL;
+ echo '
' . PHP_EOL;
}
- echo '' . PHP_EOL;
}
-
if (count($items[0]) > 0) {
render_menu($items, 0);
}