WordPress.org

Support

Support » How-To and Troubleshooting » html instead of xhtml in wp_head?

html instead of xhtml in wp_head?

  • Hello,
    I have two questions. First, what is the purpose of the stuff that wp_head() outputs? Second, how can I get it and the wp_get_archives() function to output HTML rather than XHTML (basically remove the slashes in the self-closing tags)?
    For reference, this is the code:

    <meta name='ICBM' content="0, 0" />
    <meta name='DC.title' content="DogNose Data Werkz" />
    <meta name='geo.position' content="0;0" />

    Thanks very much,
    Matthew

Viewing 4 replies - 1 through 4 (of 4 total)
  • Valid HTML 4.01 Strict 🙂
    Thanks for the info.

    Anybody know the answer to this? I’m integrating a WordPress blog into a very large “HTML 4.0 Transitional” website and unfortunately the XHTML generated by wp_get_archives(‘type=monthly&format=link’) breaks the W3C validation. wp_get_archives doesn’t return a string but only echoes it, so I can’t fix it with str_replace.

    I do not think there is an easy answer – unless you want to pick through the WP functions, templates etc etc and alter them to this.

    nah…you can just run a filter through it…it’s a bit hacky but you can probably handle it: try this:

    function fix_code($buffer) {
    $str = (str_replace(" />", ">", $buffer));
    return (str_replace("xml:lang", "lang", $str));
    }

    and

    ob_start("fix_code"); where you want it to start.
    ob_end_flush(); where it should stop

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘html instead of xhtml in wp_head?’ is closed to new replies.