Why Transitional Doctypes are Better for WordPress Blogs - EDUCATION FOR ALL

Random Posts

test banner

Breaking

Home Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Wednesday, February 29, 2012

Why Transitional Doctypes are Better for WordPress Blogs

There are many articles and resources out there that preach about XHTML versus HTML and various DOCTYPEs and their uses (a list to a couple of those articles is at the bottom of this post). But regardless of the reasons and arguments for either side, it is very clear that transitional DOCTYPES are better than strict ones for WordPress blogs.
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

Post Bottom Ad

Responsive Ads Here

Pages