[resolved] WordPress stats not XHTML compliant (2 posts)

  1. Sovattha
    Posted 9 years ago #

    I cannot understand why the javascript code of WordPress stats is written at the very end of the document, outside of the body content.

    While verifying its XHTML compliance, I have an error saying that the tag <script> is in an illegal place.

  2. terjeh
    Posted 9 years ago #

    I also had this problem, but I found out that it's not the plugin that's not XHTML compliant — it's the theme I'm currently using. Here's how I fixed it:

    • Locate your theme's footer file (should be wp-content/themes/<theme>/footer.php), and open it in your favourite text editor.
    • Find the line saying <?php wp_footer(); ?> somewhere near the end of the file and move it to the line directly above the line saying </body>.
    • Revalidate your document in the W3C validator.

    See? It's easy! :-)

Topic Closed

This topic has been closed to new replies.

About this Topic