WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Invalid Markup because of a "div" (11 posts)

  1. Hopper
    Member
    Posted 3 years ago #

    Before I spend any more hours searching through my index.php file to try to find out exactly what is causing these 10 identical error messages:

    "document type does not allow element "div" here; missing one of "object", "applet", "map", "iframe", "button", "ins", "del" start-tag"

    ...when checking my site for markup validation, I should ask others if maybe I may be looking to solve this issue in the wrong file?

    Here is my index.php file.

    Here is my weblog.

  2. elfin
    Moderator
    Posted 3 years ago #

    Try taking this section out of your <h2>...</h2>
    <div class="comments-link"><?php comments_popup_link(__('Post a Comment!', 'sandbox'), __('1 Comment', 'sandbox'), __('% Comments', 'sandbox')) ?></div>

  3. Hopper
    Member
    Posted 3 years ago #

    When I do that, it removes the link for people to be able to post a comment... but it does cause the site to validate!

    If only now to figure out how to enable the link to post a comment to be there in the index.php, but without invalidating the site.

  4. elfin
    Moderator
    Posted 3 years ago #

    reinsert it after the </h2>

  5. Hopper
    Member
    Posted 3 years ago #

    That too caused the link to disappear.

  6. Hopper
    Member
    Posted 3 years ago #

    Maybe seeing the results from the validation markup page might help?

    Here is how that came out.

  7. Hopper
    Member
    Posted 3 years ago #

    Is it possible that the necessary editing to be done is not in the index.php, but rather another file instead?

  8. elfin
    Moderator
    Posted 3 years ago #

    You've still got that div within the <h2>...</h2>

    So a suggestion, change the div to a span.

  9. Hopper
    Member
    Posted 3 years ago #

    I tried that several times and no way I tried works.

    Is this normal for something to be such a pain in the butt to fix?

    Is this the right forum for me to be asking questions like this?

  10. elfin
    Moderator
    Posted 3 years ago #

    Leave it as span, and change your style for
    div.comments-link
    to
    span.comments-link

  11. Hopper
    Member
    Posted 3 years ago #

    I just thought of that myself. In fact, that was what I was busy editing as you were probably composing your most recent post here. :)

    It was the solution! Thank you for helping to push me into that direction faster!

Topic Closed

This topic has been closed to new replies.

About this Topic