$mythemes_curr_ancestor = false; if ($item->post_parent > 0) { continue; } if (is_page($item->ID) || $item->ID === absint(get_option('page_for_posts')) && is_home()) { $classes = 'current-menu-item'; } $submenu = mythemes_tools::submenu($item->ID); if (!empty($submenu)) { $classes .= ' menu-item-has-children'; if ($mythemes_curr_ancestor) { $classes .= ' current-menu-ancestor'; } } echo '<li class="menu-item ' . esc_attr($classes) . '">'; echo '<a href="' . esc_url(get_permalink($item->ID)) . '" title="' . mythemes_tools::title($item->ID, true) . '">' . mythemes_tools::title($item->ID) . '</a>'; echo $submenu; echo '</li>'; } echo '</ul>'; echo '</div>'; } } ?> </div> <div class="mythemes-visible-navigation"></div> </nav> </div> </div>