WordPress.org

Ready to get started?Download WordPress

Forums

html instead of xhtml in wp_head? (5 posts)

  1. mjworthey
    Member
    Posted 9 years ago #

    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

  2. mjworthey
    Member
    Posted 9 years ago #

    Valid HTML 4.01 Strict :)
    Thanks for the info.

  3. walkerm
    Member
    Posted 9 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
    Member
    Posted 9 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
    Member
    Posted 9 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));
    }

    and

    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

Tags

No tags yet.