function menu_vertical($parent_id, $level = 0) { $items = menu_items($parent_id); if ($level == "") { $level = 0; } $o = ""; foreach ($items as $item) { $href = $item->link; if (!$href) { $href = "m/{$item->id}"; } $o .= "<div class=menu_item level={$level} parent_id={$parent_id} item_id={$item->id}><a href={$href}>{$item->title}</a></div>"; $o .= menu_vertical($item->id, $level + 1); } return $o; }
<a id="logo" href="<?php echo base_url(); ?> "><?php echo site_name(); ?> </a> <?php if (has_menu_items()) { ?> <nav id="main" role="navigation"> <ul> <?php while (menu_items()) { ?> <li <?php echo menu_active() ? 'class="active"' : ''; ?> > <a href="<?php echo menu_url(); ?> " title="<?php echo menu_title(); ?> "> <?php echo menu_name(); ?>
<span class="site-title" style="color: #<?php header_textcolor(); ?> ;"><?php bloginfo('name'); ?> </span> <span class="site-description" style="color: #<?php header_textcolor(); ?> ;"><?php bloginfo('description'); ?> </span> <br> <span class="page-title" style="color: #<?php header_textcolor(); ?> "><?php wp_title(); ?> </span> </div> </header> <div id="nav"> <nav> <?php menu_items(); ?> </nav> </div><!-- nav --> <div id="main">
<header> <a class="logo" href="<?php echo base_url(); ?> "><?php echo site_name(); ?> </a> <?php if (has_menu_items()) { ?> <nav class="menu" role="navigation"> <ul> <?php while (menu_items(array('sortby' => 'name'))) { ?> <li <?php echo menu_active() ? 'class="active"' : ''; ?> > <a href="<?php echo menu_url(); ?> " title="<?php echo menu_title(); ?> "> <?php echo menu_name(); ?>
function menu_with_images_and_links($parent_id) { $items = menu_items($parent_id); foreach ($items as &$item) { if (!$item->link) { $page = page_id_by_title($item->title); if ($page) { $item->link = "p/{$page}"; } } $item->img = db_result(db_query("SELECT link FROM images WHERE title='%s'", $item->title)); } $o = ""; foreach ($items as &$item) { $img = ""; if ($item->img) { $img = "<img src={$item->img}>"; } $o .= "<div class=menuItemDiv><a class=menuItem href={$item->link}>{$img}</a></div>"; } return $o; }