• Hello
    Fairly new to WP and I noticed that my feed was not getting picked up. I check the XHTML link on the blog and found this major error
    not Valid XHTML 1.1!
    The document is being served with the text/html Mime Type which is not a registered media type for the XHTML 1.1 Document Type. The recommended media type for this document is: application/xhtml+xml

    Can someone help assist me in fixing this error. I need the steps to correct this,
    Many Thanks in advance
    Jerry

Viewing 4 replies - 1 through 4 (of 4 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Jerry,

    Assuming you mean (link’s help, really) this link from your profile…

    I don’t think the XHTML validation is the issue with your feed. Your header is just not telling people where there are.

    Your feed URL is http://jerryzigmont.com/blog/wp-rss2.php

    Try adding these lines to your theme’s header.php:

    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    <link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="<?php bloginfo('atom_url'); ?>" />

    That should be the file blog/wp-content/themes/darkchoco/header.php before the </head>

    Good luck.

    Thread Starter jerryz

    (@jerryz)

    Thank you for your reply.
    I added that bit of code, but if I go to the
    Markup Validation Service

    The very first error I get is the following. How do I fix this glaring error?

    1. Warning Conflict between Mime Type and Document Type

    The document is being served with the text/html Mime Type which is not a registered media type for the XHTML 1.1 Document Type. The recommended media type for this document is: application/xhtml+xml

    Using a wrong media type for a certain document type may confuse the validator and other user agents with respect to the nature of the document, and you may get some erroneous validation errors. How to fix this problem? One of the following techniques should help:
    * If you are serving a static file on a Web server, changing its extension should help. Use e.g .xhtml for XHTML or .mathml for MathML.
    * You may need to reconfigure your Web server. This Setting up MIME Types tutorial has instructions for Apache, Tomcat and IIS.
    * If the document is generated dynamically, the scripting language should allow you to set up the mime type: this article on MIME Types and Content Negotiation has examples in PHP, Perl, and ASP.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Well XHTML validation is important (same results different browsers, standards are our friend) but even when I switch your XHTML type to validate as XHTML 1.0 Transitional I see you’ve got 99 errors or so.

    First thing I suggest is replace the first line in your header.php with one that states it’s XHTML 1.0 Transitional.

    That would be put in this line

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd">

    Transitional is more forgiving and reduces your errors from 118 to 99. It does not really change anything really but your error count will go down.

    You’ve embedded a lot of content on your blog. If your readers are able to see the content correctly (which probably is the most important consideration) then I suggest you use a plugin such as Vipers’s Video Quicktags to embed videos. His plugin generates XHTML 1.0 Strict code.

    You can fix each entry by hand (looking at the errors, _I_ would run from that task) or just make the new ones XHTML compliant going forward.

    Once again Good Luck.

    Thread Starter jerryz

    (@jerryz)

    Thank you, again. I took your advice and added the first line.

    I will go back and work on some of the previous code and use Vipers Quciktags.

    Best wishes

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Invalid XHTML 1.1 Error …How Do I Fix?’ is closed to new replies.