Support » Plugin: WP Mobile Menu » WP Mobile Menu causes validation issues

  • Resolved databell96

    (@databell96)


    I’m trying to complete the theming to my clients upcoming redesign and I noticed a bunch of validation issues withb improperly nested tags (https://validator.w3.org/nu/?doc=http%3A%2F%2Fvps30689.inmotionhosting.com%2F~myclar5%2Fbefore-and-after%2F). I noticed the majorty of them relate to code coming from WP Mobile Menu. Basically, they start right where my footer.php has </div><!– #page –> and then your plugin add a closing </div> whee no starting div or ul exists to close it. After temporarily turning off the plugin, the issues went away. But they shouldn’t have been there in the first place. Is there some way to correct this dilemma? I want my code to validate as much as possible and I certainly don’t appreciate these nesting issues.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Rui Guerreiro

    (@takanakui)

    Hi,

    Will need to take a closer look to this. You know exactly what specific div is not closed?

    Thanks
    -Rui

    No, I don.t. Basically, your plugin added an extra </div> which started out your code, so it really was trying to close something that doesn’t exist.

    Plugin Author Rui Guerreiro

    (@takanakui)

    I see, thanks. Guess I found this line that doesn’t make sense and it’s probably causing that.

    $output .= '</div></ul>';

    It’s the line 116 in the file mobile-menu/includes/class-wp-mobile-menu-core.php

    Or replace that file by this one
    https://www.dropbox.com/s/9xsb56ce3e08gj8/class-wp-mobile-menu-core.php?dl=0

    Can you give it a try?
    Thanks

    -Rui Guerreiro

    • This reply was modified 3 months, 3 weeks ago by  Rui Guerreiro. Reason: added a file link

    You mean delete it, right?

    Did that, but still getting lots of validation errors. Things like:

    • No li element in scope but a li end tag seen.
    • Element ul not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)
    • No li element in scope but a li end tag seen.

    These comments existed previously.

    I just noticed this for each and every menu item in the code:

    <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-7911"><a title="Acne Essentials 2-Step System" href="http://vps30689.inmotionhosting.com/~myclar5/product/claritymd-2-step-system/" class="">ClarityMD 2-Step System</a></li></li>

    That explains the last bullet point from the list above. It’s adding an extra to each and every link somehow.

    Plugin Author Rui Guerreiro

    (@takanakui)

    Thanks. Manage to replicate that in my dev server.
    replace the file class-wp-mobile-menu-walker-nav-menu.php located in mobile-menu/includes/ by this one in the link below.

    https://www.dropbox.com/s/bbxe38ibyxs4t5o/class-wp-mobile-menu-walker-nav-menu.php?dl=0

    -Rui

    Yes, that seemed to have helped a lot. Almost there and thanks for the assistance so far.

    One more nesting error. Seems this isn’t closed either:
    <div class="mob-menu-header-holder mobmenu" > <div class="mobmenul-container"><a href="#" class="mobmenu-left-bt"><i class="mob-icon-menu mob-menu-icon"></i><i class="mob-icon-cancel mob-cancel-button"></i></a></div><div class="mob-menu-logo-holder"><a href="http://vps30689.inmotionhosting.com/~myclar5" class="headertext">ClarityMD Official Site</a></div></div></ul></div>

    Maybe line 116 was meant to be $output .= '<div><ul>';

    Actually, I did that and the errors went away!

    However….

    C’mon, you didn’t really think we’d be finished?

    I see a new error by doing that. It is:

    Element div not allowed as child of element ul in this context. (Suppressing further errors from this subtree.)
    From line 1042, column 10; to line 1042, column 54

    Plugin Author Rui Guerreiro

    (@takanakui)

    Huum that code doesn’t seem to be from WP Mobile Menu. I don’t have any <ul> like that in the code, mines always have classes or id’s.

    Can you try to disable the plugin to see if that html it’s still there in the source?

    Also can you send me an email to [support AT wpmobilemenu DOT com]
    so I can ask some things I need in private.

    Thanks

    -Rui

    I just turned it off and then ran the HTML validator again. The issues went away. So it is the plugin. Sorry.

    I’ll email you in private shortly.

    Plugin Author Rui Guerreiro

    (@takanakui)

    This situation was sorted.

    -Rui Guerreiro

Viewing 10 replies - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.