The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

html instead of xhtml in wp_head? (5 posts)

  1. mjworthey
    Posted 11 years ago #

    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,

  2. mjworthey
    Posted 11 years ago #

    Valid HTML 4.01 Strict :)
    Thanks for the info.

  3. walkerm
    Posted 11 years ago #

    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.

  4. starritt
    Posted 11 years ago #

    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.

  5. jalenack
    Posted 11 years ago #

    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));


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

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.