\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']) . ''; $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"; } } */ B2B Paid Media & LinkedIn Ads Agency | Reach Decision-Makers

    Accelerate your business growth and increase revenue with our paid media and digital advertising services.

    Contact us today for your free consultation.