• Resolved netdesignr

    (@paladin884)


    Hi

    A client of mine is using the plugin on all his website and unfortunately, on all of them he is getting about 17 markup validation errors. All of them look very similar to the one below. Any ideas on how to address these errors without touching the plugin code directly?

    Error: Duplicate ID mega-menu-item-80.
    
    From line 147, column 505; to line 147, column 768
    
    val="100"><li class='mega-menu-item mega-menu-item-type-post_type mega-menu-item-object-page mega-menu-item-ho…current_page_item mega-align-bottom-left mega-menu-flyout mega-menu-item-80' id='mega-menu-item-80'><a cla

    Thanks a lot!

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

    (@megamenu)

    Hi netdesignr,

    This will be because your theme is outputting the menu twice on the same page, resulting in duplicate IDs. Usually it is because they output the menu once for desktop, and again for mobile. The only way to fix it would be to edit the code and remove the duplicate call to wp_nav_menu, and get it working so that the desktop menu is displayed on all screen sizes (it will collapse to a mobile style menu on smaller screens naturally).

    I think you would find the same issue (duplicate IDs) even with MMM disabled.

    Regards,
    Tom

    Thread Starter netdesignr

    (@paladin884)

    Found the issues. All the websites are using the same menu for the desktop and for the mobile. However, there are still two errors left and I hope the developer will solve them in the upcoming releases.

    1. inside style-manager.class.php -> Unnecessary type=”text/css” (markup validation)
    2. mega-toggle-block-0 is duplicated once the Mega menu instance is more than one. I’m not sure how the block number can be increased.

    Thank you!

    Thread Starter netdesignr

    (@paladin884)

    And yes Tom, the problem is exactly as you described it.
    Please let me know if the other two issues can be addressed. I’m happy to send a PR if you guys accept them.

    Plugin Author megamenu

    (@megamenu)

    Hi betdesignr,

    Good to hear you have fixed the bulk of the issues.

    1. This is how WordPress outputs styles enqueued with wp_enqueue_style, so its not something we can control directly. Please check this page for a fix:

    https://wordpress.stackexchange.com/questions/287830/remove-type-attribute-from-script-and-style-tags-added-by-wordpress

    2. Please add the following to your functions.php file:

    https://pastebin.com/raw/052QUZ9f

    Regards,
    Tom

    Thread Starter netdesignr

    (@paladin884)

    Hi Tom,

    Thank you for your quick reply.
    1. I do have that exactly script in place but for some reason, the only <style type ….> from within the Mega Menu plugin is not reachable
    2. Thank you, added the script

    Regards,
    Mihai Diaconita

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Loads of markup validation issues’ is closed to new replies.