Strict DOCTYPEs are…well, too strict. They don’t allow for certain (necessary) tags to remain in your WordPress blog. Tags such as <strike> are used by WordPress to drop a line through text. Using a Strict DOCTYPE with this is impossible; you will receive an error. Time and time again I see this while reviewing WordPress themes and plugins. It doesn’t need to happen.
Changing Your Doctype in WordPress
Under the Presentation tab click on Header. Find the following selection of code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
It should be at the top of your Header file. If you have a different setup or different theme file setup that makes it tough to find this section of code, leave a comment and I’ll see what I can do to help.
This is the code you do not want to use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
This is the code you DO want to use:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
The xmlns and the language_attributes tags can stay where they are.
Articles for more information:
No comments:
Post a Comment