WordPress.org

Ready to get started?Download WordPress

Forums

Search Template Tag / Strict (8 posts)

  1. Nachtmeister
    Member
    Posted 5 years ago #

    I've a problem with the search template tag (<?php get_search_form(); ?>). Validator says: "document type does not allow element "label" here" (xhtml 1.0 strict).

    Where can I edit the output of the Search template Tag (<?php get_search_form(); ?>)?

    I tried to set the Tag in a <p> tag, but it was not the solution.

  2. Can you provide a link? That we we can see the output and see what and if you are wrapping the search box output on.

  3. Nachtmeister
    Member
    Posted 5 years ago #

    Sorry, can't delete the htacces, isn't my webspace.

    Line 41, Column 30: document type does not allow element "label" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag .

    <label for="s" class="hidden">Search for:</label>

    ‚úČ

    The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

    One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "", "<span>", or "<font>").

    Output of Search looks so:

    # <form action="http://www.6pounder.com/nm/" id="searchform" method="get">
    # <label for="s" class="hidden">Search for:</label>
    # <div><input type="text" id="s" name="s" value=""/>
    # <input type="submit" value="Search" id="searchsubmit"/>
    # </div>
    # </form>

    So i have to set a paragraph between <form.... and </form>

    So i have to know where the search Tag get generated. Which File?

  4. Nachtmeister
    Member
    Posted 5 years ago #

    /push

    No idea? It can not be possible that no one ever got into with the search widget.

    All what I want to know is, where the stuff for the search widget is located.

  5. frinkky
    Member
    Posted 5 years ago #

    I'll bump this - I'm looking for the exact same thing.

  6. incomehero
    Member
    Posted 5 years ago #

    Same here...

  7. tech_coach
    Member
    Posted 5 years ago #

    Hi it's in wp-includes/general-template.php

    let me know if you have more questions.

  8. homechicken
    Member
    Posted 4 years ago #

    You can put your own searchform.php file in your theme and override this, or even more simply, someone at WordPress could fix this by moving the div tag above the label tag.

    It doesn't seem to change the appearance at all, and this makes it XHTML 1.0 Strict compliant.

Topic Closed

This topic has been closed to new replies.

About this Topic