هنگام استفاده از تابع wp_nav_menu
walker رو به صورت زیر صدا بزنید.
wp_nav_menu(array(
'theme_location' => 'location name',
'walker' => new mega_menu_walker()
));
کلاس مگا منو رو هم از
class mega_menu_walker extends Walker_Nav_Menu {
}
متدهای walker هم به این صورت است:
end_el — Ends the element output, if needed.
end_lvl — Ends the list of after the elements are added.
start_el — Start the element output.
start_lvl — Starts the list before the elements are added.