Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author megamenu

    (@megamenu)

    Hi hkchakladar,

    The classes and IDs are used in the correct way.

    The problem you have is the same menu is being output twice on your page. Please check your themes header.php file and make sure there is only one call to wp_nav_menu.

    Regards,
    Tom

    Thread Starter hkchakladar

    (@hkchakladar)

    Hi, thanks for replying. My theme has indeed two menu, I checked that, as you can see, one is hidden for desktop, that is only revealed on mobile.

    And its a core hook.

    header.php only inlcluded the hook and the menu is inserted using hooks, which are in core of the theme.

    So, why we can’t use class in place of IDs ?

    Plugin Author megamenu

    (@megamenu)

    IDs are used because it is the correct way identify individual elements.

    It is up to the theme author if they want to output the same menu twice. If they do then all of their users will get validation errors. You will see the same errors even with Max Mega Menu disabled/uninstalled.

    Regards,
    Tom

    Thread Starter hkchakladar

    (@hkchakladar)

    No, we don’t get that, when uninstall/disable.

    Simply because, they use different ids for mobile and desktop menu.

    #wlt_smalldevicemenubar and #core_menu_wrapper as you can also see.

    And then your menu is appended to both this ids.

    Plugin Author megamenu

    (@megamenu)

    Does the menu not output IDs for each menu item too?

    IDs are used on the wrapper to give the CSS that MMM generates a higher priority over theme CSS (unless the theme CSS is based on IDs too, which is unusual).

    The solution is to remove the second wp_nav_menu call and make it so your single menu is visible on both desktop and mobile.

    Regards,
    Tom

    Thread Starter hkchakladar

    (@hkchakladar)

    Does your menu offers any php tag or shortcode, so that I can used it on my header.php and wipe out that hooks, that call two menus ? Can I do that ?

    Plugin Author megamenu

    (@megamenu)

    Yes, if you go to Mega Menu > General Settings, under Menu Locations you will see the output options (PHP code or shortcode) for each menu location. The PHP code is simply a standard wp_nav_menu() call.

    Regards,
    Tom

    Thread Starter hkchakladar

    (@hkchakladar)

    ok, I will try wp_nav_menu() in place of that hook.

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘w3 validator shows lots of duplicate menu IDs error.’ is closed to new replies.