class Submenu_Wrapper_Walker extends Walker_Nav_Menu
{
function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
$output .= "\n$indent
\n";
}
}
class Main_Menu_Walker extends Walker_Nav_Menu
{
private $in_megamenu = false;
function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
if ($depth === 0 && $this->in_megamenu) {
$output .= "\n$indent\n";
} else if ($depth === 0) {
$output .= "
\n";
} else {
$output .= "\n";
}
}
}
/*
// Possible use without utility div on other dropdowns
class Main_Menu_Walker extends Walker_Nav_Menu
{
private $in_megamenu = [];
function start_lvl(&$output, $depth = 0, $args = array())
{
$indent = str_repeat("\t", $depth);
if ($depth === 0 && !empty($this->in_megamenu[$depth])) {
$output .= "\n$indent";
}
$output .= "\n";
}
function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
{
$classes = empty($item->classes) ? [] : (array) $item->classes;
// Track megamenu only on top-level items
if ($depth === 0) {
$this->in_megamenu[$depth] = in_array('megamenu', $classes, true);
}
$class_names = $classes
? ' class="' . esc_attr(implode(' ', $classes)) . '"'
: '';
$item_id = 'menu-item-' . $item->ID;
$output .= '';
// Optional megamenu image
if (get_field('mega_menu_image', $item)) {
$image = get_field('mega_menu_image', $item);
$output .= '';
$output .= '';
$output .= '
![' . esc_attr($image['title']) . '](' . esc_url($image['url']) . ')
';
$output .= '
';
$output .= '';
}
$atts = [];
if (!empty($item->url)) {
$atts['href'] = esc_url($item->url);
}
$attributes = '';
foreach ($atts as $attr => $value) {
$attributes .= ' ' . $attr . '="' . $value . '"';
}
$title = apply_filters('the_title', $item->title, $item->ID);
$output .= '' . $title . '';
if (!empty($item->description)) {
$output .= '' . $item->description . '';
}
}
function end_el(&$output, $item, $depth = 0, $args = array())
{
$output .= "\n";
}
}
*/
https://mar-com.net/post-sitemap.xml
2026-10-20T15:08:11+00:00
https://mar-com.net/page-sitemap.xml
2026-10-23T16:21:34+00:00
https://mar-com.net/case-study-sitemap.xml
2026-10-14T13:36:21+00:00
https://mar-com.net/category-sitemap.xml
2026-10-20T15:08:11+00:00
https://mar-com.net/case-study-category-sitemap.xml
2026-10-14T13:36:21+00:00
https://mar-com.net/author-sitemap.xml
2025-12-12T16:22:23+00:00